public final class AllOf extends Object implements Scalar<Boolean>
true
when all items in the collection are true
.
You can use this class in order to iterate all items
in the collection. This is very similar to the forEach()
in steams, but more object oriented. For example, if you want
to print all items from the array:
new AllOf( new TransformedIterable<String>( Arrays.asList("hello", "world"), new ProcAsFunc<>(i -> System.out.println(i)) ) ).asValue();
Or even more compact, through IterableAsBooleans
:
new AllOf( new IterableAsBooleans<String>( Arrays.asList("hello", "world"), i -> System.out.println(i) ) ).asValue();
Or you can even use IterableAsBoolean
:
new IterableAsBoolean<String>( Arrays.asList("hello", "world"), i -> System.out.println(i) ).asValue();
There is no thread-safety guarantee.
Copyright © 2017 Cactoos. All rights reserved.