@Test public void testEmptyInsetOperator() throws Exception { List<Integer> values = new ArrayList<>(); InsetOperator<Integer> insetOperator = new InsetOperator<>("in-set", values); assertEquals(Flag.FlagResultStatus.DISABLED, insetOperator.appliesTo(2)); assertEquals(Flag.FlagResultStatus.DISABLED, insetOperator.appliesTo(6)); }
@Override public Flag.FlagResultStatus appliesTo(@Nullable T value) { if (null != values) { for (T v : values) { if (v.equals(value)) return Flag.FlagResultStatus.ENABLED; } } return Flag.FlagResultStatus.DISABLED; }
InsetOperator extends Operator<T> { @Override public Flag.FlagResultStatus appliesTo(@Nullable T value) { if (null != values) { for (T v : values) { if (v.equals(value)) return Flag.FlagResultStatus.ENABLED; } } return Flag.FlagResultStatus.DISABLED; } }
InsetOperator extends Operator<T> { @Override public Flag.FlagResultStatus appliesTo(@Nullable T value) { if (null != values) { for (T v : values) { if (v.equals(value)) return Flag.FlagResultStatus.ENABLED; } } return Flag.FlagResultStatus.DISABLED; } InsetOperator(String name, List<T> values); }
InsetOperator extends Operator<T> { @Override public Flag.FlagResultStatus appliesTo(@Nullable T value) { if (null != values) { for (T v : values) { if (v.equals(value)) return Flag.FlagResultStatus.ENABLED; } } return Flag.FlagResultStatus.DISABLED; } InsetOperator(String name, List<T> values); @Override Flag.FlagResultStatus appliesTo(@Nullable T value); }
InsetOperator extends Operator<T> { @Override public Flag.FlagResultStatus appliesTo(@Nullable T value) { if (null != values) { for (T v : values) { if (v.equals(value)) return Flag.FlagResultStatus.ENABLED; } } return Flag.FlagResultStatus.DISABLED; } InsetOperator(String name, List<T> values); @Override Flag.FlagResultStatus appliesTo(@Nullable T value);  }