public class Outcome<T>
extends java.lang.Object
T
is the class of the result of the task in the event that it is successfulConstructor and Description |
---|
Outcome(java.lang.Exception exception)
Create a failure outcome
|
Outcome(T result)
Create a success outcome
|
Modifier and Type | Method and Description |
---|---|
java.lang.Exception |
getException()
Get the result of the task if it was unsuccessful
|
T |
getResult()
Get the result of the task if it was successful
|
boolean |
isSuccess()
Ask if the task was successful
|
public Outcome(T result)
result
- the successful outcomepublic Outcome(java.lang.Exception exception)
exception
- the unsuccessful outcomepublic boolean isSuccess()
public T getResult()
public java.lang.Exception getException()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.