@Test public void serializationTest() throws Exception { Expression expression = dsl.equal(DSL.literal("v1"), DSL.literal("v2")); ByteArrayOutputStream output = new ByteArrayOutputStream(); ObjectOutputStream objectOutput = new ObjectOutputStream(output); objectOutput.writeObject(expression); objectOutput.flush(); String source = Base64.getEncoder().encodeToString(output.toByteArray()); ByteArrayInputStream input = new ByteArrayInputStream(Base64.getDecoder().decode(source)); ObjectInputStream objectInput = new ObjectInputStream(input); Expression e = (Expression) objectInput.readObject(); ExprValue exprValue = e.valueOf(valueEnv()); assertEquals(LITERAL_FALSE, exprValue); }
private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); }
BinaryPredicateOperator { private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); } }
BinaryPredicateOperator { private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); }  }
BinaryPredicateOperator { private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); }  static void register(BuiltinFunctionRepository repository); }
BinaryPredicateOperator { private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); }  static void register(BuiltinFunctionRepository repository);  }