public class Outcome<T> extends Object
T is the class of the result of the task in the event that it is successful| Constructor and Description | 
|---|
Outcome(Exception exception)
Create a failure outcome 
 | 
Outcome(T result)
Create a success outcome 
 | 
| Modifier and Type | Method and Description | 
|---|---|
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(Exception exception)
exception - the unsuccessful outcomepublic boolean isSuccess()
public T getResult()
public Exception getException()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.