Class Either<L,R>
java.lang.Object
org.ehrbase.openehr.sdk.util.functional.Either<L,R>
- Direct Known Subclasses:
Either.Left,Either.Right,Try
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidconsume(BiConsumer<L, R> con) Convenience method to consume the internal stateabstract Objectget()abstract Labstract Rabstract booleanisLeft()abstract booleanisRight()static <L1,R1> Either.Left<L1, R1> left(L1 value) abstract <T> Tmap(BiFunction<L, R, T> map) Convenience method to transform the internal statestatic <L1,R1> Either.Right<L1, R1> right(R1 value)
-
Field Details
-
value
-
-
Constructor Details
-
Either
-
-
Method Details
-
left
-
right
-
isLeft
public abstract boolean isLeft() -
isRight
public abstract boolean isRight() -
get
-
getAsLeft
-
getAsRight
-
map
Convenience method to transform the internal state- Parameters:
map- function which maps the internal state to the specified type The function must be null safe in both arguments- Returns:
- the mapped internal state
-
consume
Convenience method to consume the internal state- Parameters:
con- consumer which consumes the internal state The consumer must be null safe in both arguments
-