@Test public void invokeParamIsNull() { FunctionTestUtil.assertResultError( coincidesFunction.invoke((Comparable) null, (Comparable) "b" ), InvalidParametersEvent.class ); FunctionTestUtil.assertResultError( coincidesFunction.invoke((Comparable) "a", (Comparable) null ), InvalidParametersEvent.class ); }
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")); } }
CoincidesFunction 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")); } } }
CoincidesFunction 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")); } } CoincidesFunction(); }
CoincidesFunction 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")); } } CoincidesFunction(); FEELFnResult<Boolean> invoke(@ParameterName( "value1" ) Comparable value1, @ParameterName( "value2" ) Comparable value2); FEELFnResult<Boolean> invoke(@ParameterName( "range1" ) Range range1, @ParameterName( "range2" ) Range range2); }
CoincidesFunction 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")); } } CoincidesFunction(); FEELFnResult<Boolean> invoke(@ParameterName( "value1" ) Comparable value1, @ParameterName( "value2" ) Comparable value2); FEELFnResult<Boolean> invoke(@ParameterName( "range1" ) Range range1, @ParameterName( "range2" ) Range range2); static final CoincidesFunction INSTANCE; }