BinaryPredicateOperator { private static FunctionResolver notLike() { return FunctionDSL.define(BuiltinFunctionName.NOT_LIKE.getName(), FunctionDSL .impl(FunctionDSL.nullMissingHandling( (v1, v2) -> UnaryPredicateOperator.not(OperatorUtils.matches(v1, v2))), BOOLEAN, STRING, STRING)); }  static void register(BuiltinFunctionRepository repository);  }
@Test public void test_not_like() { FunctionExpression notLike = dsl.notLike(DSL.literal("bob"), DSL.literal("tom")); assertEquals(BOOLEAN, notLike.type()); assertTrue(notLike.valueOf(valueEnv()).booleanValue()); assertEquals(String.format("not like(\"%s\", \"%s\")", "bob", "tom"), notLike.toString()); notLike = dsl.notLike(DSL.literal("bob"), DSL.literal("bo%")); assertFalse(notLike.valueOf(valueEnv()).booleanValue()); assertEquals(String.format("not like(\"%s\", \"%s\")", "bob", "bo%"), notLike.toString()); }