Package com.ocient.util
Class CompletableFutures.FailedResult<T,E extends Exception>
java.lang.Object
com.ocient.util.CompletableFutures.FailedResult<T,E>
- Type Parameters:
T- the type of the success value (unused in this case)
- All Implemented Interfaces:
com.ibm.asyncutil.util.Either<T,,E> CompletableFutures.Result<T,E>
- Direct Known Subclasses:
TransportResult.FailedTransportResult
- Enclosing class:
- CompletableFutures
public static class CompletableFutures.FailedResult<T,E extends Exception>
extends Object
implements CompletableFutures.Result<T,E>
A Result that represents a failed operation.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFailedResult(E exception) Constructs a new FailedResult with the givenException. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.ocient.util.CompletableFutures.Result
equals, isException, isSuccess, mapSuccess, recoverMethods inherited from interface com.ibm.asyncutil.util.Either
flatMap, forEach, left, map, map, right
-
Field Details
-
exception
-
-
Constructor Details
-
Method Details
-
isLeft
public boolean isLeft() -
isRight
public boolean isRight() -
get
Description copied from interface:CompletableFutures.ResultReturns the success result reason. If this Result represents an error, the fail cause is thrown. -
orElseThrow
Description copied from interface:CompletableFutures.ResultReturns the success value of this Result. If this Result represents an error, an IllegalStateException is thrown.- Specified by:
orElseThrowin interfaceCompletableFutures.Result<T,E extends Exception> - Returns:
- the success value
-
getException
Description copied from interface:CompletableFutures.ResultReturns the fail cause. If this Result represents success, anSQLStates.OKis returned.- Specified by:
getExceptionin interfaceCompletableFutures.Result<T,E extends Exception> - Returns:
- the fail cause or
SQLStates.OKif success
-
fold
-
hashCode
public int hashCode() -
equals
-
toString
Returns a string representation of this FailedResult.
-