|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.bc.ServiceResultImpl
com.atlassian.jira.bc.ServiceOutcomeImpl<T>
public class ServiceOutcomeImpl<T>
Generic service outcome that can optionally hold a value.
Constructor Summary | |
---|---|
ServiceOutcomeImpl(ErrorCollection errorCollection)
Creates a new ServiceOutcomeImpl with the given errors. |
|
ServiceOutcomeImpl(ErrorCollection errorCollection,
T value)
Creates a new ServiceOutcomeImpl with the given errors and returned value. |
Method Summary | ||
---|---|---|
static
|
error(String errorMessage)
Convenience method that returns a new ServiceOutcomeImpl instance containing the provided error message, and no return value. |
|
static
|
from(ErrorCollection errorCollection,
T value)
Convenience method that returns a new ServiceOutcomeImpl containing the given errors and returned value. |
|
T |
getReturnedValue()
Returns the value that was returned by the service, or null. |
|
static
|
ok(T returnedValue)
Convenience method that returns a new ServiceOutcomeImpl instance containing no errors, and with the provided returned value. |
Methods inherited from class com.atlassian.jira.bc.ServiceResultImpl |
---|
getErrorCollection, isValid |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.jira.bc.ServiceResult |
---|
getErrorCollection, isValid |
Constructor Detail |
---|
public ServiceOutcomeImpl(ErrorCollection errorCollection)
errorCollection
- an ErrorCollectionpublic ServiceOutcomeImpl(ErrorCollection errorCollection, T value)
errorCollection
- an ErrorCollectionvalue
- the wrapped valueMethod Detail |
---|
public static <T> ServiceOutcomeImpl<T> ok(T returnedValue)
T
- the type of the returned valuereturnedValue
- the returned value
public static <T> ServiceOutcomeImpl<T> error(String errorMessage)
T
- the type of the returned valueerrorMessage
- the error message to include in the ServiceOutcomeImpl
public static <T> ServiceOutcomeImpl<T> from(ErrorCollection errorCollection, T value)
T
- the type of the returned valueerrorCollection
- an ErrorCollectionvalue
- the returned value
public T getReturnedValue()
getReturnedValue
in interface ServiceOutcome<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |