Class Try<S,E extends Exception>
java.lang.Object
org.ehrbase.openehr.sdk.util.functional.Either<S,E>
org.ehrbase.openehr.sdk.util.functional.Try<S,E>
- Direct Known Subclasses:
Try.Failure,Try.Success
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTry.Failure<S0,E0 extends Exception> static classTry.Success<S0,E0 extends Exception> Nested classes/interfaces inherited from class org.ehrbase.openehr.sdk.util.functional.Either
Either.Left<L,R>, Either.Right<L, R> -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidconsume(BiConsumer<S, E> con) Convenience method to consume the internal statestatic <S1,E1 extends Exception>
Try.Failure<S1,E1> failure(E1 failure) abstract Objectget()abstract Try.Failure<S,E> abstract Try.Success<S,E> abstract Sabstract booleanbooleanisLeft()booleanisRight()abstract booleanabstract <T> Tmap(BiFunction<S, E, T> map) Convenience method to transform the internal statestatic <S1,E1 extends Exception>
Try.Success<S1,E1> success(S1 result) Methods inherited from class org.ehrbase.openehr.sdk.util.functional.Either
getAsLeft, getAsRight, left, right
-
Constructor Details
-
Try
-
-
Method Details
-
success
-
failure
-
isLeft
public boolean isLeft() -
isRight
public boolean isRight() -
isSuccess
public abstract boolean isSuccess() -
isFailure
public abstract boolean isFailure() -
get
-
getOrThrow
-
getAsSuccess
-
getAsFailure
-
map
Convenience method to transform the internal state -
consume
Convenience method to consume the internal state
-