@Test public void invokeMatchNotExists() { FunctionTestUtil.assertResult(substringBeforeFunction.invoke("foobar", "oook"), ""); }
public FEELFnResult<String> invoke(@ParameterName("string") String string, @ParameterName("match") String match) { if ( string == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "string", "cannot be null" ) ); } if ( match == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "match", "cannot be null" ) ); } int index = string.indexOf( match ); if ( index > 0 ) { return FEELFnResult.ofResult( string.substring( 0, index ) ); } else { return FEELFnResult.ofResult( "" ); } }
SubstringBeforeFunction extends BaseFEELFunction { public FEELFnResult<String> invoke(@ParameterName("string") String string, @ParameterName("match") String match) { if ( string == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "string", "cannot be null" ) ); } if ( match == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "match", "cannot be null" ) ); } int index = string.indexOf( match ); if ( index > 0 ) { return FEELFnResult.ofResult( string.substring( 0, index ) ); } else { return FEELFnResult.ofResult( "" ); } } }
SubstringBeforeFunction extends BaseFEELFunction { public FEELFnResult<String> invoke(@ParameterName("string") String string, @ParameterName("match") String match) { if ( string == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "string", "cannot be null" ) ); } if ( match == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "match", "cannot be null" ) ); } int index = string.indexOf( match ); if ( index > 0 ) { return FEELFnResult.ofResult( string.substring( 0, index ) ); } else { return FEELFnResult.ofResult( "" ); } } SubstringBeforeFunction(); }
SubstringBeforeFunction extends BaseFEELFunction { public FEELFnResult<String> invoke(@ParameterName("string") String string, @ParameterName("match") String match) { if ( string == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "string", "cannot be null" ) ); } if ( match == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "match", "cannot be null" ) ); } int index = string.indexOf( match ); if ( index > 0 ) { return FEELFnResult.ofResult( string.substring( 0, index ) ); } else { return FEELFnResult.ofResult( "" ); } } SubstringBeforeFunction(); FEELFnResult<String> invoke(@ParameterName("string") String string, @ParameterName("match") String match); }
SubstringBeforeFunction extends BaseFEELFunction { public FEELFnResult<String> invoke(@ParameterName("string") String string, @ParameterName("match") String match) { if ( string == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "string", "cannot be null" ) ); } if ( match == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( Severity.ERROR, "match", "cannot be null" ) ); } int index = string.indexOf( match ); if ( index > 0 ) { return FEELFnResult.ofResult( string.substring( 0, index ) ); } else { return FEELFnResult.ofResult( "" ); } } SubstringBeforeFunction(); FEELFnResult<String> invoke(@ParameterName("string") String string, @ParameterName("match") String match);  }