@PublicApi public interface ServiceOutcome<T> extends ServiceResult
Modifier and Type | Method and Description |
---|---|
default <R> R |
fold(java.util.function.Function<? super T,R> onSuccess,
java.util.function.Function<? super ErrorCollection,R> onFailure)
Folds this outcome into a value using the given functions.
|
T |
get()
Returns the value that was returned by the service, or null.
|
T |
getReturnedValue()
Returns the value that was returned by the service, or null.
|
getErrorCollection, getWarningCollection, hasWarnings, isValid
T getReturnedValue()
T get()
default <R> R fold(@Nonnull java.util.function.Function<? super T,R> onSuccess, @Nonnull java.util.function.Function<? super ErrorCollection,R> onFailure)
ServiceResult.getWarningCollection()
.
If your use case requires you to process warnings, use the other methods in
this interface.R
- the return typeonSuccess
- the function to apply when ServiceResult.isValid()
returns trueonFailure
- the function to apply when ServiceResult.isValid()
returns falseCopyright © 2002-2017 Atlassian. All Rights Reserved.