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"); } } } }
private static Object getLiteral(Configuration conf, ExprNodeDesc child, BoxType boxType) { if (child instanceof ExprNodeConstantDesc) { return boxLiteral((ExprNodeConstantDesc) child, boxType); } else if (child instanceof ExprNodeDynamicValueDesc) { LiteralDelegate value = ((ExprNodeDynamicValueDesc) child).getDynamicValue(); value.setConf(conf); return value; } return null; }
private static Object getLiteral(Configuration conf, ExprNodeDesc child, PredicateLeaf.Type type) { if (child instanceof ExprNodeConstantDesc) { return boxLiteral((ExprNodeConstantDesc) child, type); } else if (child instanceof ExprNodeDynamicValueDesc) { LiteralDelegate value = ((ExprNodeDynamicValueDesc) child).getDynamicValue(); value.setConf(conf); return value; } return null; }
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"); } } } }