Package io.ultreia.java4all.util
Interface TwoSide
-
- All Known Implementing Classes:
LeftOrRight
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface TwoSide
To be able to program with natural API in a two side context.Created at 19/03/2024.
- Since:
- 1.1.13
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <O> voidaccept(O o, Consumer<O> leftCandidate, Consumer<O> rightCandidate)default <O,V>
Vapply(O o, Function<O,V> leftCandidate, Function<O,V> rightCandidate)default <O> Ocall(Callable<O> leftCandidate, Callable<O> rightCandidate)default <O> Oget(O leftCandidate, O rightCandidate)Choose the correct object for this side.booleanonLeft()default voidrun(Runnable leftCandidate, Runnable rightCandidate)default <O> booleantest(O o, Predicate<O> leftCandidate, Predicate<O> rightCandidate)
-
-
-
Method Detail
-
onLeft
boolean onLeft()
- Returns:
- true if this object represents the left side,
falseotherwise.
-
get
default <O> O get(O leftCandidate, O rightCandidate)Choose the correct object for this side.- Type Parameters:
O- type of candidate- Parameters:
leftCandidate- the left side candidaterightCandidate- the right side candidate- Returns:
- the candidate for this side
-
-