public class Predicates extends Object
Constructor and Description |
---|
Predicates() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.function.Predicate<T> |
distinctByKey(java.util.function.Function<? super T,Object> extractor)
Returns thread-safe stateful predicate that returns whether it has seen the extracted value.
|
static <T> java.util.function.Predicate<T> |
distinctByKey(java.util.function.Function<? super T,Object> extractor,
int initialCapacity)
Returns thread-safe stateful predicate that returns whether it has seen the extracted value.
|
static <T,S extends Set<Object>> |
distinctByKey(java.util.function.Function<? super T,Object> extractor,
S seenSet)
Returns stateful predicate that returns whether it has seen the extracted value.
|
public static <T> java.util.function.Predicate<T> distinctByKey(java.util.function.Function<? super T,Object> extractor)
T
- output typeextractor
- function that should be used to extract the valuepublic static <T> java.util.function.Predicate<T> distinctByKey(java.util.function.Function<? super T,Object> extractor, int initialCapacity)
T
- output typeextractor
- function that should be used to extract the valueinitialCapacity
- initial capacity of internal state (a.k.a. how many unique elements you expect it to see)public static <T,S extends Set<Object>> java.util.function.Predicate<T> distinctByKey(java.util.function.Function<? super T,Object> extractor, S seenSet)
T
- output typeextractor
- function that should be used to extract the valueseenSet
- backing collection that will be used to store whether given value was seenCopyright © 2002-2024 Atlassian. All Rights Reserved.