@Override public int hashCode() { return operator.hashCode() + type.hashCode() * 17 + columnName.hashCode() * 3 * 17+ (literal == null ? 0 : literal.hashCode()) * 101 * 3 * 17 + (literalList == null ? 0 : literalList.hashCode()) * 103 * 101 * 3 * 17; }
protected void checkLiteralType(Object literal, Type type, Configuration conf) { if (literal == null) { return; } if (literal instanceof LiteralDelegate) { // Give it a pass. Optionally, have LiteralDelegate provide a getLiteralClass() to check. ((LiteralDelegate) literal).setConf(conf); } else { if (literal.getClass() != type.getValueClass()) { throw new IllegalArgumentException("Wrong value class " + literal.getClass().getName() + " for " + type + "." + operator + " leaf"); } } } }
public PredicateLeafImpl(Operator operator, Type type, String columnName, Object literal, List<Object> literalList, Configuration conf) { this.operator = operator; this.type = type; this.columnName = columnName; this.literal = literal; checkLiteralType(literal, type, conf); this.literalList = literalList; if (literalList != null) { Class valueCls = type.getValueClass(); for(Object lit: literalList) { checkLiteralType(lit, type, conf); } } }
protected void checkLiteralType(Object literal, Type type, Configuration conf) { if (literal == null) { return; } if (literal instanceof LiteralDelegate) { // Give it a pass. Optionally, have LiteralDelegate provide a getLiteralClass() to check. ((LiteralDelegate) literal).setConf(conf); } else { if (literal.getClass() != type.getValueClass()) { throw new IllegalArgumentException("Wrong value class " + literal.getClass().getName() + " for " + type + "." + operator + " leaf"); } } } }
@Override public int hashCode() { return operator.hashCode() + type.hashCode() * 17 + columnName.hashCode() * 3 * 17+ (literal == null ? 0 : literal.hashCode()) * 101 * 3 * 17 + (literalList == null ? 0 : literalList.hashCode()) * 103 * 101 * 3 * 17; }
@Override public int hashCode() { return operator.hashCode() + type.hashCode() * 17 + columnName.hashCode() * 3 * 17+ (literal == null ? 0 : literal.hashCode()) * 101 * 3 * 17 + (literalList == null ? 0 : literalList.hashCode()) * 103 * 101 * 3 * 17; } }
public PredicateLeafImpl(Operator operator, Type type, String columnName, Object literal, List<Object> literalList, Configuration conf) { this.operator = operator; this.type = type; this.columnName = columnName; this.literal = literal; checkLiteralType(literal, type, conf); this.literalList = literalList; if (literalList != null) { Class valueCls = type.getValueClass(); for(Object lit: literalList) { checkLiteralType(lit, type, conf); } } }