Class Result.Success<T,E>
java.lang.Object
com.dudko.tools.safejavastreams.core.Result<T,E>
com.dudko.tools.safejavastreams.core.Result.Success<T,E>
Success 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> U
Applies 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.boolean
Returns 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
-
value
-
-
Constructor Details
-
Success
-
-
Method Details
-
isSuccess
public boolean isSuccess()Description copied from class:Result
Returns true if this is a success result. -
get
Description copied from class:Result
Returns the success value or throws if failure. -
getError
Description copied from class:Result
Returns the error value or throws if success. -
map
Description copied from class:Result
Applies the function to the success value. -
flatMap
Description copied from class:Result
Applies 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:Result
Applies one of two functions depending on the result type. -
mapError
Description copied from class:Result
Maps the error value if this is a failure.
-