Package org.apache.juneau.internal
Class ConsumerUtils
java.lang.Object
org.apache.juneau.internal.ConsumerUtils
Utilities when working with
Predicates
and Consumers
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
Consumes the specified value if it's the specified type and the predicate isnull or matches the specified value.static <T> void
Consumes the specified value if the predicate isnull or matches the specified value.static <T> boolean
Returnstrue if the specified object is the specified type and the specified predicate isnull or matches the specified value.static <T> boolean
Returnstrue if the specified predicate isnull or matches the specified value.
-
Constructor Details
-
ConsumerUtils
public ConsumerUtils()
-
-
Method Details
-
test
Returnstrue if the specified predicate isnull or matches the specified value.- Type Parameters:
T
- The type being tested.- Parameters:
predicate
- The predicate.value
- The value to test.- Returns:
true if the specified predicate isnull or matches the specified value.
-
test
Returnstrue if the specified object is the specified type and the specified predicate isnull or matches the specified value.- Type Parameters:
T
- The type being tested.- Parameters:
type
- The expected type.predicate
- The predicate.value
- The value.- Returns:
true if the specified predicate isnull or matches the specified value.
-
consume
Consumes the specified value if the predicate isnull or matches the specified value.- Type Parameters:
T
- The type being consumed.- Parameters:
predicate
- The predicate.consumer
- The consumer.value
- The value.
-
consume
public static <T> void consume(Class<T> type, Predicate<T> predicate, Consumer<T> consumer, Object value) Consumes the specified value if it's the specified type and the predicate isnull or matches the specified value.- Type Parameters:
T
- The type being consumed.- Parameters:
type
- The expected type.predicate
- The predicate.consumer
- The consumer.value
- The value.
-