public FlowAllMatch<B> all(Filter<B> filter) { return then(new FlowAllMatch<B>(filter)); }
@Override public void process(T t) { if (!filter.allow(t)) { stop(result = Boolean.FALSE); } } }
@Test public void test_all() { Assert.assertTrue(Flow.of(1, 3, 5).all(new Filter<Integer>() { @Override public boolean allow(Integer integer) { return integer % 2 != 0; } }).get()); Assert.assertFalse(Flow.of(1, 2, 3).all(new Filter<Integer>() { @Override public boolean allow(Integer integer) { return integer % 2 != 0; } }).get()); }
@Override public void process(T t) { if (!filter.allow(t)) { stop(result = Boolean.FALSE); } } }
public FlowAllMatch<B> all(Filter<B> filter) { return then(new FlowAllMatch<B>(filter)); }