Class Result.Failure<T,E>
java.lang.Object
com.dudko.tools.safejavastreams.core.Result<T,E>
com.dudko.tools.safejavastreams.core.Result.Failure<T,E>
Failure branch implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.dudko.tools.safejavastreams.core.Result
Result.Failure<T,E>, Result.Success<T, E> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApplies the function to the success value, returning another Result.<U> UApplies one of two functions depending on the result type.get()Returns the success value or throws if failure.getError()Returns the error value or throws if success.booleanReturns true if this is a success result.Applies the function to the success value.Maps the error value if this is a failure.Methods inherited from class com.dudko.tools.safejavastreams.core.Result
failure, filter, getOrElse, getOrElseGet, isFailure, onFailure, onSuccess, orElseThrow, peek, recover, recoverWith, success, toEither, toOptional
-
Field Details
-
error
-
-
Constructor Details
-
Failure
-
-
Method Details
-
isSuccess
public boolean isSuccess()Description copied from class:ResultReturns true if this is a success result. -
get
Description copied from class:ResultReturns the success value or throws if failure. -
getError
Description copied from class:ResultReturns the error value or throws if success. -
map
Description copied from class:ResultApplies the function to the success value. -
flatMap
Description copied from class:ResultApplies the function to the success value, returning another Result. -
fold
public <U> U fold(Function<? super E, ? extends U> failureMapper, Function<? super T, ? extends U> successMapper) Description copied from class:ResultApplies one of two functions depending on the result type. -
mapError
Description copied from class:ResultMaps the error value if this is a failure.
-