@Test public void invokeParamSingleAndRange() { FunctionTestUtil.assertResult( beforeFunction.invoke( "a", new RangeImpl( Range.RangeBoundary.CLOSED, "a", "f", Range.RangeBoundary.CLOSED )), Boolean.FALSE ); FunctionTestUtil.assertResult( beforeFunction.invoke( "f", new RangeImpl( Range.RangeBoundary.CLOSED, "a", "f", Range.RangeBoundary.CLOSED )), Boolean.FALSE ); FunctionTestUtil.assertResult( beforeFunction.invoke( "a", new RangeImpl( Range.RangeBoundary.OPEN, "a", "f", Range.RangeBoundary.CLOSED )), Boolean.TRUE ); FunctionTestUtil.assertResult( beforeFunction.invoke( "a", new RangeImpl( Range.RangeBoundary.CLOSED, "b", "f", Range.RangeBoundary.CLOSED )), Boolean.TRUE ); }
public FEELFnResult<Boolean> invoke(@ParameterName( "value1" ) Comparable value1, @ParameterName( "value2" ) Comparable value2) { if ( value1 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be null")); } if ( value2 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value2", "cannot be null")); } try { boolean result = value1.compareTo( value2 ) < 0; return FEELFnResult.ofResult( result ); } catch( Exception e ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be compared to value2")); } }
BeforeFunction extends BaseFEELFunction { public FEELFnResult<Boolean> invoke(@ParameterName( "value1" ) Comparable value1, @ParameterName( "value2" ) Comparable value2) { if ( value1 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be null")); } if ( value2 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value2", "cannot be null")); } try { boolean result = value1.compareTo( value2 ) < 0; return FEELFnResult.ofResult( result ); } catch( Exception e ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be compared to value2")); } } }
BeforeFunction extends BaseFEELFunction { public FEELFnResult<Boolean> invoke(@ParameterName( "value1" ) Comparable value1, @ParameterName( "value2" ) Comparable value2) { if ( value1 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be null")); } if ( value2 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value2", "cannot be null")); } try { boolean result = value1.compareTo( value2 ) < 0; return FEELFnResult.ofResult( result ); } catch( Exception e ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be compared to value2")); } } BeforeFunction(); }
BeforeFunction extends BaseFEELFunction { public FEELFnResult<Boolean> invoke(@ParameterName( "value1" ) Comparable value1, @ParameterName( "value2" ) Comparable value2) { if ( value1 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be null")); } if ( value2 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value2", "cannot be null")); } try { boolean result = value1.compareTo( value2 ) < 0; return FEELFnResult.ofResult( result ); } catch( Exception e ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be compared to value2")); } } BeforeFunction(); FEELFnResult<Boolean> invoke(@ParameterName( "value1" ) Comparable value1, @ParameterName( "value2" ) Comparable value2); FEELFnResult<Boolean> invoke(@ParameterName( "value" ) Comparable value, @ParameterName( "range" ) Range range); FEELFnResult<Boolean> invoke(@ParameterName( "range" ) Range range, @ParameterName( "value" ) Comparable value); FEELFnResult<Boolean> invoke(@ParameterName( "range1" ) Range range1, @ParameterName( "range2" ) Range range2); }
BeforeFunction extends BaseFEELFunction { public FEELFnResult<Boolean> invoke(@ParameterName( "value1" ) Comparable value1, @ParameterName( "value2" ) Comparable value2) { if ( value1 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be null")); } if ( value2 == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value2", "cannot be null")); } try { boolean result = value1.compareTo( value2 ) < 0; return FEELFnResult.ofResult( result ); } catch( Exception e ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "value1", "cannot be compared to value2")); } } BeforeFunction(); FEELFnResult<Boolean> invoke(@ParameterName( "value1" ) Comparable value1, @ParameterName( "value2" ) Comparable value2); FEELFnResult<Boolean> invoke(@ParameterName( "value" ) Comparable value, @ParameterName( "range" ) Range range); FEELFnResult<Boolean> invoke(@ParameterName( "range" ) Range range, @ParameterName( "value" ) Comparable value); FEELFnResult<Boolean> invoke(@ParameterName( "range1" ) Range range1, @ParameterName( "range2" ) Range range2); static final BeforeFunction INSTANCE; }