@Test public void invokeListNull() { FunctionTestUtil.assertResultError(listContainsFunction.invoke((List) null, null), InvalidParametersEvent.class); FunctionTestUtil.assertResultError(listContainsFunction.invoke(null, new Object()), InvalidParametersEvent.class); }
public FEELFnResult<Boolean> invoke(@ParameterName("list") List list, @ParameterName("element") Object element) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } else { if (element == null) { return FEELFnResult.ofResult(list.contains(element)); } else { Object e = EvalHelper.coerceNumber(element); boolean found = false; ListIterator<?> it = list.listIterator(); while (it.hasNext() && !found) { Object next = EvalHelper.coerceNumber(it.next()); found = e.equals(next); } return FEELFnResult.ofResult(found); } } }
ListContainsFunction extends BaseFEELFunction { public FEELFnResult<Boolean> invoke(@ParameterName("list") List list, @ParameterName("element") Object element) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } else { if (element == null) { return FEELFnResult.ofResult(list.contains(element)); } else { Object e = EvalHelper.coerceNumber(element); boolean found = false; ListIterator<?> it = list.listIterator(); while (it.hasNext() && !found) { Object next = EvalHelper.coerceNumber(it.next()); found = e.equals(next); } return FEELFnResult.ofResult(found); } } } }
ListContainsFunction extends BaseFEELFunction { public FEELFnResult<Boolean> invoke(@ParameterName("list") List list, @ParameterName("element") Object element) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } else { if (element == null) { return FEELFnResult.ofResult(list.contains(element)); } else { Object e = EvalHelper.coerceNumber(element); boolean found = false; ListIterator<?> it = list.listIterator(); while (it.hasNext() && !found) { Object next = EvalHelper.coerceNumber(it.next()); found = e.equals(next); } return FEELFnResult.ofResult(found); } } } ListContainsFunction(); }
ListContainsFunction extends BaseFEELFunction { public FEELFnResult<Boolean> invoke(@ParameterName("list") List list, @ParameterName("element") Object element) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } else { if (element == null) { return FEELFnResult.ofResult(list.contains(element)); } else { Object e = EvalHelper.coerceNumber(element); boolean found = false; ListIterator<?> it = list.listIterator(); while (it.hasNext() && !found) { Object next = EvalHelper.coerceNumber(it.next()); found = e.equals(next); } return FEELFnResult.ofResult(found); } } } ListContainsFunction(); FEELFnResult<Boolean> invoke(@ParameterName("list") List list, @ParameterName("element") Object element); }
ListContainsFunction extends BaseFEELFunction { public FEELFnResult<Boolean> invoke(@ParameterName("list") List list, @ParameterName("element") Object element) { if ( list == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null")); } else { if (element == null) { return FEELFnResult.ofResult(list.contains(element)); } else { Object e = EvalHelper.coerceNumber(element); boolean found = false; ListIterator<?> it = list.listIterator(); while (it.hasNext() && !found) { Object next = EvalHelper.coerceNumber(it.next()); found = e.equals(next); } return FEELFnResult.ofResult(found); } } } ListContainsFunction(); FEELFnResult<Boolean> invoke(@ParameterName("list") List list, @ParameterName("element") Object element);  }