MathematicalFunction { private static FunctionResolver degrees() { return FunctionDSL.define(BuiltinFunctionName.DEGREES.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> new ExprDoubleValue(Math.toDegrees(v.doubleValue()))), type, DOUBLE)).collect(Collectors.toList())); }  static void register(BuiltinFunctionRepository repository);  }
@Test public void degrees_null_value() { FunctionExpression degrees = dsl.degrees(DSL.ref(DOUBLE_TYPE_NULL_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, degrees.type()); assertTrue(degrees.valueOf(valueEnv()).isNull()); }
@Test public void degrees_missing_value() { FunctionExpression degrees = dsl.degrees(DSL.ref(DOUBLE_TYPE_MISSING_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, degrees.type()); assertTrue(degrees.valueOf(valueEnv()).isMissing()); }