Package science.aist.jack.stream
Class FilterStreamUtils
- java.lang.Object
-
- science.aist.jack.stream.FilterStreamUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Predicate<T>
distinctByKeys(Function<? super T,?>... keyExtractors)
Method that helps to distinct a stream by multiple properties
-
-
-
Method Detail
-
distinctByKeys
@SafeVarargs public static <T> Predicate<T> distinctByKeys(Function<? super T,?>... keyExtractors)
Method that helps to distinct a stream by multiple properties
Stream<Xyz> s = ...; Stream<Xyz> sDistinct = s.filter(FilterStreamUtils.distinctByKeys(Xyz::getAbc, Xyz::getDef, ...));
- Type Parameters:
T
- the type of the class of the stream- Parameters:
keyExtractors
- array of key extractor functions- Returns:
- a predicate that is used inside filter methods of streams.
- See Also:
- Java 8 stream distinct by multiple fields
-
-