| Package | Description |
|---|---|
| com.opengamma.strata.collect.result |
Result data structures.
|
| Modifier and Type | Method and Description |
|---|---|
static <T,R> Result<R> |
Result.combine(Iterable<? extends Result<T>> results,
Function<Stream<T>,R> function)
Takes a collection of results, checks if all of them are successes
and then applies the supplied function to the successes wrapping
the result in a success result.
|
<U,R> Result<R> |
Result.combineWith(Result<U> other,
BiFunction<T,U,Result<R>> function)
Combines this result with another result.
|
static <R> Result<R> |
Result.failure(Exception cause)
Creates a failed result caused by an exception.
|
static <R> Result<R> |
Result.failure(Exception cause,
String message,
Object... messageArgs)
Creates a failed result caused by an exception.
|
static <R> Result<R> |
Result.failure(Failure failure)
Creates a failed result containing a failure.
|
static <R> Result<R> |
Result.failure(FailureItem failureItem)
Creates a failed result containing a failure item.
|
static <R> Result<R> |
Result.failure(FailureReason reason,
Exception cause)
Creates a failed result caused by an exception with a specified reason.
|
static <R> Result<R> |
Result.failure(FailureReason reason,
Exception cause,
String message,
Object... messageArgs)
Creates a failed result caused by an exception with a specified reason and message.
|
static <R> Result<R> |
Result.failure(FailureReason reason,
String message,
Object... messageArgs)
Creates a failed result specifying the failure reason.
|
static <R> Result<R> |
Result.failure(FailureReason reason,
Throwable cause)
Creates a failed result caused by a throwable with a specified reason.
|
static <R> Result<R> |
Result.failure(FailureReason reason,
Throwable cause,
String message,
Object... messageArgs)
Creates a failed result caused by a throwable with a specified reason and message.
|
static <R> Result<R> |
Result.failure(Iterable<? extends Result<?>> results)
Creates a failed result combining multiple failed results.
|
static <R> Result<R> |
Result.failure(Result<?> failureResult)
Returns a failed result from another failed result.
|
static <R> Result<R> |
Result.failure(Result<?> result1,
Result<?> result2,
Result<?>... results)
Creates a failed result combining multiple failed results.
|
static <R> Result<R> |
Result.failure(Throwable cause)
Creates a failed result caused by a throwable.
|
static <R> Result<R> |
Result.failure(Throwable cause,
String message,
Object... messageArgs)
Creates a failed result caused by a throwable.
|
static <T,R> Result<R> |
Result.flatCombine(Iterable<? extends Result<T>> results,
Function<Stream<T>,Result<R>> function)
Takes a collection of results, checks if all of them are successes
and then applies the supplied function to the successes.
|
<R> Result<R> |
Result.flatMap(Function<? super T,Result<R>> function)
Processes a successful result by applying a function that returns another result.
|
<R> Result<R> |
Result.map(Function<? super T,? extends R> function)
Processes a successful result by applying a function that alters the value.
|
static <T> Result<T> |
Result.of(Supplier<T> supplier)
Creates a success
Result wrapping the value produced by the
supplier. |
static <R> Result<R> |
Result.ofNullable(R value)
Returns a success result containing the value if it is non-null, else returns a failure result
with a reason of
FailureReason.MISSING_DATA and message to say an unexpected null was found. |
static <R> Result<R> |
Result.ofNullable(R value,
FailureReason reason,
String message,
Object... messageArgs)
Returns a success result containing the value if it is non-null, else returns a failure result
with the specified reason and message.
|
static <R> Result<R> |
Result.success(R value)
Creates a successful result wrapping a value.
|
static <T> Result<T> |
Result.wrap(Supplier<Result<T>> supplier)
Creates a
Result wrapping the result produced by the supplier. |
| Modifier and Type | Method and Description |
|---|---|
Class<? extends Result<T>> |
Result.Meta.beanType() |
org.joda.beans.BeanBuilder<? extends Result<T>> |
Result.Meta.builder() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
Result.allSuccessful(Result<?>... results)
Checks if all the results are successful.
|
static boolean |
Result.anyFailures(Result<?>... results)
Checks if any of the results are failures.
|
<U,R> Result<R> |
Result.combineWith(Result<U> other,
BiFunction<T,U,Result<R>> function)
Combines this result with another result.
|
static long |
Result.countFailures(Result<?>... results)
Counts how many of the results are failures.
|
static <R> Result<R> |
Result.failure(Result<?> failureResult)
Returns a failed result from another failed result.
|
static <R> Result<R> |
Result.failure(Result<?> result1,
Result<?> result2,
Result<?>... results)
Creates a failed result combining multiple failed results.
|
static <R> Result<R> |
Result.failure(Result<?> result1,
Result<?> result2,
Result<?>... results)
Creates a failed result combining multiple failed results.
|
static <R> Result<R> |
Result.failure(Result<?> result1,
Result<?> result2,
Result<?>... results)
Creates a failed result combining multiple failed results.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
Result.allSuccessful(Iterable<? extends Result<?>> results)
Checks if all the results are successful.
|
static boolean |
Result.anyFailures(Iterable<? extends Result<?>> results)
Checks if any of the results are failures.
|
static <T,R> Result<R> |
Result.combine(Iterable<? extends Result<T>> results,
Function<Stream<T>,R> function)
Takes a collection of results, checks if all of them are successes
and then applies the supplied function to the successes wrapping
the result in a success result.
|
<U,R> Result<R> |
Result.combineWith(Result<U> other,
BiFunction<T,U,Result<R>> function)
Combines this result with another result.
|
static long |
Result.countFailures(Iterable<? extends Result<?>> results)
Counts how many of the results are failures.
|
static <R> Result<R> |
Result.failure(Iterable<? extends Result<?>> results)
Creates a failed result combining multiple failed results.
|
static <T,R> Result<R> |
Result.flatCombine(Iterable<? extends Result<T>> results,
Function<Stream<T>,Result<R>> function)
Takes a collection of results, checks if all of them are successes
and then applies the supplied function to the successes.
|
static <T,R> Result<R> |
Result.flatCombine(Iterable<? extends Result<T>> results,
Function<Stream<T>,Result<R>> function)
Takes a collection of results, checks if all of them are successes
and then applies the supplied function to the successes.
|
<R> Result<R> |
Result.flatMap(Function<? super T,Result<R>> function)
Processes a successful result by applying a function that returns another result.
|
static <T> Result<T> |
Result.wrap(Supplier<Result<T>> supplier)
Creates a
Result wrapping the result produced by the supplier. |
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.