Class ExpressionBuilder

java.lang.Object
com.e1c.langtool.history.db.query.ExpressionBuilder

public final class ExpressionBuilder extends Object
Builder to construct immutable expressions based on operations.

This builder creates expressions with operations in the reversed order and considers boolean operators as unary.

For example this query expression:

ExpressionBuilder.where(Criteries.valueEqual("val"))
          .and(Criteries.langEqual("en"))
          .andNot(Criteries.projectEqual("proj")).build();
 
will be represented as the following tree:
                    AND
                    /\
                   /  \
                 AND  NOT
                 /\     \
                /  \    project='proj'
               /    \
 value EQUAL 'val'   language = 'en'