Package no.digipost
Class DiggPredicates
java.lang.Object
no.digipost.DiggPredicates
-
Method Summary
-
Method Details
-
nth
Create a new predicate which only yields true on the nthtrue-yielding invocation of a given predicate.As this is a stateful predicate, it should usually not be kept as a reference, but used inline when processing a number of elements, with
streams.- Parameters:
n- the nthtrue-yielding invocation,1indicates first,2second, and so forth.0or less will throw anIllegalArgumentException.predicate- the predicate.- Returns:
- the new predicate.
-