com.atlassian.greenhopper.service
Interface ServiceOutcome<T>
- All Superinterfaces:
- com.atlassian.fugue.Effect.Applicant<T>
- All Known Implementing Classes:
- ServiceOutcomeImpl
public interface ServiceOutcome<T>
- extends com.atlassian.fugue.Effect.Applicant<T>
A service result that has an value.
Methods inherited from interface com.atlassian.fugue.Effect.Applicant |
foreach |
isValid
boolean isValid()
- Returns:
- true if there are no errors, false otherwise.
getErrors
ErrorCollection getErrors()
- Returns:
- an
ErrorCollection
that contains any errors that may have happened as a result of the validations.
getValue
T getValue()
- Returns the value that was returned by the service, or null.
- Returns:
- the value returned by the service, or null
map
<A> ServiceOutcome<A> map(com.google.common.base.Function<T,A> func)
- Type Parameters:
A
- the type of the ServiceOutcome- Parameters:
func
- a function which takes a instance of type T and returns an instance of type A
- Returns:
- a new service outcome based on the output of func
flatMap
<A> ServiceOutcome<A> flatMap(com.google.common.base.Function<T,ServiceOutcome<A>> func)
- Type Parameters:
A
- the type of the ServiceOutcome- Parameters:
func
- a function which takes a instance of type T and returns a ServiceOutcome of type A
- Returns:
- a new service outcome based on the output of func
Copyright © 2007-2012 Atlassian. All Rights Reserved.