@Test public void testAbsFunctionDuration() { FunctionTestUtil.assertResult(absFunction.invoke(Duration.ofSeconds(100, 50 )), Duration.ofSeconds(100, 50)); FunctionTestUtil.assertResult(absFunction.invoke(Duration.ofSeconds(-100, 50 )), Duration.ofSeconds(100, -50)); FunctionTestUtil.assertResult(absFunction.invoke(Duration.ofSeconds(100, -50 )), Duration.ofSeconds(100, -50)); FunctionTestUtil.assertResult(absFunction.invoke(Duration.ofSeconds(-100, -50 )), Duration.ofSeconds(100, 50)); FunctionTestUtil.assertResultError(absFunction.invoke((Duration)null), InvalidParametersEvent.class); }
public FEELFnResult<BigDecimal> invoke(@ParameterName( "n" ) BigDecimal number) { if ( number == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "number", "cannot be null")); } return FEELFnResult.ofResult( number.abs() ); }
AbsFunction extends BaseFEELFunction { public FEELFnResult<BigDecimal> invoke(@ParameterName( "n" ) BigDecimal number) { if ( number == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "number", "cannot be null")); } return FEELFnResult.ofResult( number.abs() ); } }
AbsFunction extends BaseFEELFunction { public FEELFnResult<BigDecimal> invoke(@ParameterName( "n" ) BigDecimal number) { if ( number == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "number", "cannot be null")); } return FEELFnResult.ofResult( number.abs() ); } AbsFunction(); }
AbsFunction extends BaseFEELFunction { public FEELFnResult<BigDecimal> invoke(@ParameterName( "n" ) BigDecimal number) { if ( number == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "number", "cannot be null")); } return FEELFnResult.ofResult( number.abs() ); } AbsFunction(); FEELFnResult<BigDecimal> invoke(@ParameterName( "n" ) BigDecimal number); FEELFnResult<Period> invoke(@ParameterName( "n" ) Period duration); FEELFnResult<Duration> invoke(@ParameterName( "n" ) Duration duration); }
AbsFunction extends BaseFEELFunction { public FEELFnResult<BigDecimal> invoke(@ParameterName( "n" ) BigDecimal number) { if ( number == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "number", "cannot be null")); } return FEELFnResult.ofResult( number.abs() ); } AbsFunction(); FEELFnResult<BigDecimal> invoke(@ParameterName( "n" ) BigDecimal number); FEELFnResult<Period> invoke(@ParameterName( "n" ) Period duration); FEELFnResult<Duration> invoke(@ParameterName( "n" ) Duration duration); static final AbsFunction INSTANCE; }