@Override public Builder in(String column, PredicateLeaf.Type type, Object... literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { if (literal.length == 0) { throw new IllegalArgumentException("Can't create in expression with " + "no arguments"); } List<Object> argList = new ArrayList<Object>(); argList.addAll(Arrays.asList(literal)); PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.IN, type, column, null, argList, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder between(String column, PredicateLeaf.Type type, Object lower, Object upper) { ExpressionTree parent = currentTree.getFirst(); if (column == null || lower == null || upper == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { List<Object> argList = new ArrayList<Object>(); argList.add(lower); argList.add(upper); PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.BETWEEN, type, column, null, argList, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder isNull(String column, PredicateLeaf.Type type) { ExpressionTree parent = currentTree.getFirst(); if (column == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.IS_NULL, type, column, null, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder in(String column, PredicateLeaf.Type type, Object... literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { if (literal.length == 0) { throw new IllegalArgumentException("Can't create in expression with " + "no arguments"); } List<Object> argList = new ArrayList<Object>(); argList.addAll(Arrays.asList(literal)); PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.IN, type, column, null, argList, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder between(String column, PredicateLeaf.Type type, Object lower, Object upper) { ExpressionTree parent = currentTree.getFirst(); if (column == null || lower == null || upper == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { List<Object> argList = new ArrayList<Object>(); argList.add(lower); argList.add(upper); PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.BETWEEN, type, column, null, argList, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder equals(String column, PredicateLeaf.Type type, Object literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.EQUALS, type, column, literal, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder lessThan(String column, PredicateLeaf.Type type, Object literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.LESS_THAN, type, column, literal, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder lessThanEquals(String column, PredicateLeaf.Type type, Object literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.LESS_THAN_EQUALS, type, column, literal, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder isNull(String column, PredicateLeaf.Type type) { ExpressionTree parent = currentTree.getFirst(); if (column == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.IS_NULL, type, column, null, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder nullSafeEquals(String column, PredicateLeaf.Type type, Object literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.NULL_SAFE_EQUALS, type, column, literal, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder equals(String column, PredicateLeaf.Type type, Object literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.EQUALS, type, column, literal, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder lessThanEquals(String column, PredicateLeaf.Type type, Object literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.LESS_THAN_EQUALS, type, column, literal, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder lessThan(String column, PredicateLeaf.Type type, Object literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.LESS_THAN, type, column, literal, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }
@Override public Builder nullSafeEquals(String column, PredicateLeaf.Type type, Object literal) { ExpressionTree parent = currentTree.getFirst(); if (column == null || literal == null) { parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL)); } else { PredicateLeaf leaf = new PredicateLeafImpl(PredicateLeaf.Operator.NULL_SAFE_EQUALS, type, column, literal, null, conf); parent.getChildren().add(new ExpressionTree(addLeaf(leaf))); } return this; }