Modifier and Type | Class and Description |
---|---|
static class |
Try.Failure<T>
Represents a failed try.
|
static class |
Try.Success<T>
Represents a successful try.
|
Modifier and Type | Method and Description |
---|---|
static <T> Try<T> |
Try.failure(Throwable cause)
Creates a failed try.
|
abstract <R> Try<R> |
Try.flatMap(Function<? super T,Try<R>> func)
Maps successful tries through
func , passes failure through as is. |
<R> Try<R> |
Try.Success.flatMap(Function<? super T,Try<R>> func) |
<R> Try<R> |
Try.Failure.flatMap(Function<? super T,Try<R>> func) |
abstract <R> Try<R> |
Try.map(Function<? super T,R> func)
Maps successful tries through
func , passees failure through as is. |
<R> Try<R> |
Try.Success.map(Function<? super T,R> func) |
<R> Try<R> |
Try.Failure.map(Function<? super T,R> func) |
abstract Try<T> |
Try.recover(Function<? super Throwable,T> func)
Maps failed tries through
func , passes success through as is. |
Try<T> |
Try.Success.recover(Function<? super Throwable,T> func) |
Try<T> |
Try.Failure.recover(Function<? super Throwable,T> func) |
abstract Try<T> |
RFuture.result()
Returns the result of this future, or null if it is not yet complete.
|
Try<T> |
RPromise.result() |
static <T> Try<T> |
Try.success(T value)
Creates a successful try.
|
Modifier and Type | Method and Description |
---|---|
Slot<Try<T>> |
RPromise.completer()
Returns a slot that can be used to complete this promise.
|
static <T,R> Function<Try<T>,Try<R>> |
Try.lift(Function<T,R> func)
Lifts
func , a function on values, to a function on tries. |
static <T,R> Function<Try<T>,Try<R>> |
Try.lift(Function<T,R> func)
Lifts
func , a function on values, to a function on tries. |
Modifier and Type | Method and Description |
---|---|
void |
RPromise.complete(Try<T> result)
Causes this promise to be completed with
result . |
static <T> RFuture<T> |
RFuture.result(Try<T> result)
Returns a future with an already-computed result.
|
Modifier and Type | Method and Description |
---|---|
abstract <R> Try<R> |
Try.flatMap(Function<? super T,Try<R>> func)
Maps successful tries through
func , passes failure through as is. |
<R> Try<R> |
Try.Success.flatMap(Function<? super T,Try<R>> func) |
<R> Try<R> |
Try.Failure.flatMap(Function<? super T,Try<R>> func) |
RFuture<T> |
RFuture.onComplete(SignalView.Listener<? super Try<T>> slot)
Causes
slot to be notified when this future is completed. |
<R> RFuture<R> |
RFuture.transform(Function<Try<? super T>,Try<R>> func)
Transforms this future by mapping its result upon arrival.
|
<R> RFuture<R> |
RFuture.transform(Function<Try<? super T>,Try<R>> func)
Transforms this future by mapping its result upon arrival.
|
Copyright © 2017. All rights reserved.