@Test public void invokeListNull() { FunctionTestUtil.assertResultError(indexOfFunction.invoke((List) null, null), InvalidParametersEvent.class); FunctionTestUtil.assertResultError(indexOfFunction.invoke(null, new Object()), InvalidParametersEvent.class); }
public FEELFnResult<List<BigDecimal>> invoke(@ParameterName( "list" ) List list, @ParameterName( "match" ) Object match) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } final List<BigDecimal> result = new ArrayList<>(); for( int i = 0; i < list.size(); i++ ) { Object o = list.get( i ); if ( o == null && match == null) { result.add( BigDecimal.valueOf( i+1 ) ); } else if ( o != null && match != null ) { if ( equalsAsBigDecimals(o, match) || o.equals(match) ) { result.add( BigDecimal.valueOf( i+1 ) ); } } } return FEELFnResult.ofResult( result ); }
IndexOfFunction extends BaseFEELFunction { public FEELFnResult<List<BigDecimal>> invoke(@ParameterName( "list" ) List list, @ParameterName( "match" ) Object match) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } final List<BigDecimal> result = new ArrayList<>(); for( int i = 0; i < list.size(); i++ ) { Object o = list.get( i ); if ( o == null && match == null) { result.add( BigDecimal.valueOf( i+1 ) ); } else if ( o != null && match != null ) { if ( equalsAsBigDecimals(o, match) || o.equals(match) ) { result.add( BigDecimal.valueOf( i+1 ) ); } } } return FEELFnResult.ofResult( result ); } }
IndexOfFunction extends BaseFEELFunction { public FEELFnResult<List<BigDecimal>> invoke(@ParameterName( "list" ) List list, @ParameterName( "match" ) Object match) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } final List<BigDecimal> result = new ArrayList<>(); for( int i = 0; i < list.size(); i++ ) { Object o = list.get( i ); if ( o == null && match == null) { result.add( BigDecimal.valueOf( i+1 ) ); } else if ( o != null && match != null ) { if ( equalsAsBigDecimals(o, match) || o.equals(match) ) { result.add( BigDecimal.valueOf( i+1 ) ); } } } return FEELFnResult.ofResult( result ); } IndexOfFunction(); }
IndexOfFunction extends BaseFEELFunction { public FEELFnResult<List<BigDecimal>> invoke(@ParameterName( "list" ) List list, @ParameterName( "match" ) Object match) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } final List<BigDecimal> result = new ArrayList<>(); for( int i = 0; i < list.size(); i++ ) { Object o = list.get( i ); if ( o == null && match == null) { result.add( BigDecimal.valueOf( i+1 ) ); } else if ( o != null && match != null ) { if ( equalsAsBigDecimals(o, match) || o.equals(match) ) { result.add( BigDecimal.valueOf( i+1 ) ); } } } return FEELFnResult.ofResult( result ); } IndexOfFunction(); FEELFnResult<List<BigDecimal>> invoke(@ParameterName( "list" ) List list, @ParameterName( "match" ) Object match); }
IndexOfFunction extends BaseFEELFunction { public FEELFnResult<List<BigDecimal>> invoke(@ParameterName( "list" ) List list, @ParameterName( "match" ) Object match) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } final List<BigDecimal> result = new ArrayList<>(); for( int i = 0; i < list.size(); i++ ) { Object o = list.get( i ); if ( o == null && match == null) { result.add( BigDecimal.valueOf( i+1 ) ); } else if ( o != null && match != null ) { if ( equalsAsBigDecimals(o, match) || o.equals(match) ) { result.add( BigDecimal.valueOf( i+1 ) ); } } } return FEELFnResult.ofResult( result ); } IndexOfFunction(); FEELFnResult<List<BigDecimal>> invoke(@ParameterName( "list" ) List list, @ParameterName( "match" ) Object match);  }