Class BiPredicateWithContext<IN1,IN2>
- java.lang.Object
-
- nl.talsmasoftware.context.delegation.Wrapper<T>
-
- nl.talsmasoftware.context.delegation.WrapperWithContext<T>
-
- nl.talsmasoftware.context.functions.BiPredicateWithContext<IN1,IN2>
-
- All Implemented Interfaces:
BiPredicate<IN1,IN2>
public class BiPredicateWithContext<IN1,IN2> extends WrapperWithContext<T> implements BiPredicate<IN1,IN2>
A wrapper forBiPredicatethatreactivates a context snapshotbefore calling a delegate.- Author:
- Sjoerd Talsma
-
-
Field Summary
Fields Modifier and Type Field Description protected Consumer<ContextSnapshot>contextSnapshotConsumerThe context snapshot consumer to provide a new snapshot to after the function is completed, may benull.
-
Constructor Summary
Constructors Modifier Constructor Description protectedBiPredicateWithContext(Supplier<ContextSnapshot> supplier, BiPredicate<IN1,IN2> delegate, Consumer<ContextSnapshot> consumer)BiPredicateWithContext(ContextSnapshot snapshot, BiPredicate<IN1,IN2> delegate)BiPredicateWithContext(ContextSnapshot snapshot, BiPredicate<IN1,IN2> delegate, Consumer<ContextSnapshot> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BiPredicate<IN1,IN2>and(BiPredicate<? super IN1,? super IN2> other)protected Optional<Consumer<ContextSnapshot>>consumer()Deprecated.The functional wrappers currently no longer use this method.BiPredicate<IN1,IN2>or(BiPredicate<? super IN1,? super IN2> other)booleantest(IN1 in1, IN2 in2)-
Methods inherited from class nl.talsmasoftware.context.delegation.WrapperWithContext
equals, hashCode, snapshot, toString
-
Methods inherited from class nl.talsmasoftware.context.delegation.Wrapper
delegate, nonNullDelegate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.function.BiPredicate
negate
-
-
-
-
Field Detail
-
contextSnapshotConsumer
protected final Consumer<ContextSnapshot> contextSnapshotConsumer
The context snapshot consumer to provide a new snapshot to after the function is completed, may benull.
-
-
Constructor Detail
-
BiPredicateWithContext
public BiPredicateWithContext(ContextSnapshot snapshot, BiPredicate<IN1,IN2> delegate)
-
BiPredicateWithContext
public BiPredicateWithContext(ContextSnapshot snapshot, BiPredicate<IN1,IN2> delegate, Consumer<ContextSnapshot> consumer)
-
BiPredicateWithContext
protected BiPredicateWithContext(Supplier<ContextSnapshot> supplier, BiPredicate<IN1,IN2> delegate, Consumer<ContextSnapshot> consumer)
-
-
Method Detail
-
and
public BiPredicate<IN1,IN2> and(BiPredicate<? super IN1,? super IN2> other)
- Specified by:
andin interfaceBiPredicate<IN1,IN2>
-
or
public BiPredicate<IN1,IN2> or(BiPredicate<? super IN1,? super IN2> other)
- Specified by:
orin interfaceBiPredicate<IN1,IN2>
-
consumer
@Deprecated protected Optional<Consumer<ContextSnapshot>> consumer()
Deprecated.The functional wrappers currently no longer use this method.- Returns:
- An optional post-action consumer to receive a new context snapshot taken after the action.
-
-