@Test public void testContains() { Contains action = new Contains(); assertTrue(ObjectFieldActions.contains(action, null)); assertFalse(ObjectFieldActions.contains(action, Arrays.asList(new Object[] {""}))); Object[] array = new Object[] {false, "foo", 2}; Object[] arrayWithNull = new Object[] {false, null, "foo", 2}; assertFalse(ObjectFieldActions.contains(action, Arrays.asList(array))); assertTrue(ObjectFieldActions.contains(action, Arrays.asList(arrayWithNull))); action.setValue("foo"); assertFalse(ObjectFieldActions.contains(action, null)); assertFalse(ObjectFieldActions.contains(action, Arrays.asList(new Object[] {""}))); assertFalse(ObjectFieldActions.contains(action, Arrays.asList(new Object[] {"foobar"}))); assertTrue(ObjectFieldActions.contains(action, Arrays.asList(array))); }
@AtlasActionProcessor public static Boolean contains(Contains contains, List<Object> inputs) { if (contains == null) { throw new IllegalArgumentException("Contains action must be specified"); } if (inputs == null) { return contains.getValue() == null; } return collectionContains(inputs, contains); }
ObjectFieldActions implements AtlasFieldAction { @AtlasActionProcessor public static Boolean contains(Contains contains, List<Object> inputs) { if (contains == null) { throw new IllegalArgumentException("Contains action must be specified"); } if (inputs == null) { return contains.getValue() == null; } return collectionContains(inputs, contains); } }
ObjectFieldActions implements AtlasFieldAction { @AtlasActionProcessor public static Boolean contains(Contains contains, List<Object> inputs) { if (contains == null) { throw new IllegalArgumentException("Contains action must be specified"); } if (inputs == null) { return contains.getValue() == null; } return collectionContains(inputs, contains); }  }
ObjectFieldActions implements AtlasFieldAction { @AtlasActionProcessor public static Boolean contains(Contains contains, List<Object> inputs) { if (contains == null) { throw new IllegalArgumentException("Contains action must be specified"); } if (inputs == null) { return contains.getValue() == null; } return collectionContains(inputs, contains); }  @AtlasActionProcessor static Integer count(Count action, List<Object> inputs); @AtlasActionProcessor static Boolean contains(Contains contains, List<Object> inputs); @AtlasActionProcessor static Boolean equals(Equals equals, Object input); @AtlasActionProcessor static Boolean isNull(IsNull action, Object input); @AtlasActionProcessor static Object itemAt(ItemAt itemAt, List<Object> inputs); @AtlasActionProcessor static Integer length(Length length, Object input); }
ObjectFieldActions implements AtlasFieldAction { @AtlasActionProcessor public static Boolean contains(Contains contains, List<Object> inputs) { if (contains == null) { throw new IllegalArgumentException("Contains action must be specified"); } if (inputs == null) { return contains.getValue() == null; } return collectionContains(inputs, contains); }  @AtlasActionProcessor static Integer count(Count action, List<Object> inputs); @AtlasActionProcessor static Boolean contains(Contains contains, List<Object> inputs); @AtlasActionProcessor static Boolean equals(Equals equals, Object input); @AtlasActionProcessor static Boolean isNull(IsNull action, Object input); @AtlasActionProcessor static Object itemAt(ItemAt itemAt, List<Object> inputs); @AtlasActionProcessor static Integer length(Length length, Object input);  }