@Test public void isToBeTriggeredOnFalseNegative() { TriggerStrategy strategy = onFalse(getSupplier()); boolean result = strategy.isToBeTriggered(null); assertFalse(result); assertTrue(strategy.getChannelIdentifiers().contains("test")); TriggerStrategy clone = ClonerUtil.clone(strategy); assertFalse(clone.isToBeTriggered(null)); }
public static TriggerStrategy onFalse(Supplier<Boolean> supplier){ return new LambdaTriggerStrategy( values -> supplier.extract(values) != null && !supplier.extract(values), () -> new HashSet<>(supplier.getChannelIdentifiers()) ); }
TriggerStrategies { public static TriggerStrategy onFalse(Supplier<Boolean> supplier){ return new LambdaTriggerStrategy( values -> supplier.extract(values) != null && !supplier.extract(values), () -> new HashSet<>(supplier.getChannelIdentifiers()) ); } }
TriggerStrategies { public static TriggerStrategy onFalse(Supplier<Boolean> supplier){ return new LambdaTriggerStrategy( values -> supplier.extract(values) != null && !supplier.extract(values), () -> new HashSet<>(supplier.getChannelIdentifiers()) ); } private  TriggerStrategies(); }
TriggerStrategies { public static TriggerStrategy onFalse(Supplier<Boolean> supplier){ return new LambdaTriggerStrategy( values -> supplier.extract(values) != null && !supplier.extract(values), () -> new HashSet<>(supplier.getChannelIdentifiers()) ); } private  TriggerStrategies(); static TriggerStrategy onTrue(Supplier<Boolean> supplier); static TriggerStrategy onFalse(Supplier<Boolean> supplier); static TriggerStrategy onBecomeTrue(Supplier<Boolean> supplier); static TriggerStrategy onBecomeTrue(Supplier<Boolean> supplier, Boolean initialValue); static TriggerStrategy onBecomeFalse(Supplier<Boolean> supplier); static TriggerStrategy onBecomeFalse(Supplier<Boolean> supplier, Boolean initialValue); static TriggerStrategy onChange(Supplier<T> supplier); static TriggerStrategy onChange(Supplier<T> supplier, T initialValue); static TriggerStrategy onNull(Supplier<T> supplier); static TriggerStrategy onNotNull(Supplier<T> supplier); static TriggerStrategy always(); }
TriggerStrategies { public static TriggerStrategy onFalse(Supplier<Boolean> supplier){ return new LambdaTriggerStrategy( values -> supplier.extract(values) != null && !supplier.extract(values), () -> new HashSet<>(supplier.getChannelIdentifiers()) ); } private  TriggerStrategies(); static TriggerStrategy onTrue(Supplier<Boolean> supplier); static TriggerStrategy onFalse(Supplier<Boolean> supplier); static TriggerStrategy onBecomeTrue(Supplier<Boolean> supplier); static TriggerStrategy onBecomeTrue(Supplier<Boolean> supplier, Boolean initialValue); static TriggerStrategy onBecomeFalse(Supplier<Boolean> supplier); static TriggerStrategy onBecomeFalse(Supplier<Boolean> supplier, Boolean initialValue); static TriggerStrategy onChange(Supplier<T> supplier); static TriggerStrategy onChange(Supplier<T> supplier, T initialValue); static TriggerStrategy onNull(Supplier<T> supplier); static TriggerStrategy onNotNull(Supplier<T> supplier); static TriggerStrategy always();  }