| Modifier and Type | Class and Description |
|---|---|
class |
Failure<T> |
class |
Success<T> |
| Modifier and Type | Method and Description |
|---|---|
static <U> Try<U> |
Try.failure(Throwable throwable) |
abstract <U> Try<U> |
Try.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Throwable> mapper)
Applies a function on two values.
|
<U> Try<U> |
Success.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Throwable> mapper) |
<U> Try<U> |
Failure.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Throwable> mapper) |
abstract <U> Try<U> |
Try.map(ThrowingFunction<? super T,? extends U,? extends Throwable> mapper)
Applies a function on a value of type Success.
|
<U> Try<U> |
Success.map(ThrowingFunction<? super T,? extends U,? extends Throwable> mapper) |
<U> Try<U> |
Failure.map(ThrowingFunction<? super T,? extends U,? extends Throwable> mapper) |
static <U,V,W> Try<U> |
Try.of(ThrowingBiFunction<V,W,? extends U,? extends Throwable> func,
V v,
W w)
Starting point to the Try structure.
|
static <U,V> Try<U> |
Try.of(ThrowingFunction<V,? extends U,? extends Throwable> func,
V v)
Starting point to the Try structure.
|
static <U> Try<U> |
Try.of(ThrowingSupplier<U,? extends Throwable> supplier)
Starting point to the Try structure.
|
abstract Try<T> |
Try.peek(ThrowingConsumer<? super T,? extends Throwable> consumer)
Same as forEach but returns the Try for further chaining
|
Try<T> |
Success.peek(ThrowingConsumer<? super T,? extends Throwable> consumer) |
Try<T> |
Failure.peek(ThrowingConsumer<? super T,? extends Throwable> consumer) |
abstract Try<T> |
Try.peekFailure(Consumer<Failure<T>> consumer)
Does nothing on Success, but accepts a consumer on Failure
|
Try<T> |
Success.peekFailure(Consumer<Failure<T>> consumer) |
Try<T> |
Failure.peekFailure(Consumer<Failure<T>> consumer) |
| Modifier and Type | Method and Description |
|---|---|
abstract <U> Try<U> |
Try.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Throwable> mapper)
Applies a function on two values.
|
<U> Try<U> |
Success.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Throwable> mapper) |
<U> Try<U> |
Failure.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Throwable> mapper) |
Copyright © 2014–2015. All rights reserved.