| Modifier and Type | Class and Description |
|---|---|
class |
Failure<T> |
class |
Success<T> |
| Modifier and Type | Method and Description |
|---|---|
static <U> Try<U> |
Try.failure(Exception Exception) |
abstract <U> Try<U> |
Try.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Exception> mapper)
Applies a function on two values.
|
<U> Try<U> |
Success.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Exception> mapper) |
<U> Try<U> |
Failure.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Exception> mapper) |
abstract <U> Try<U> |
Try.map(ThrowingFunction<? super T,? extends U,? extends Exception> mapper)
Applies a function on a value of type Success.
|
<U> Try<U> |
Success.map(ThrowingFunction<? super T,? extends U,? extends Exception> mapper) |
<U> Try<U> |
Failure.map(ThrowingFunction<? super T,? extends U,? extends Exception> mapper) |
static <U,V,W> Try<U> |
Try.of(ThrowingBiFunction<V,W,? extends U,? extends Exception> func,
V v,
W w)
Starting point to the Try structure.
|
static <U,V> Try<U> |
Try.of(ThrowingFunction<V,? extends U,? extends Exception> func,
V v)
Starting point to the Try structure.
|
static <U> Try<U> |
Try.of(ThrowingSupplier<U,? extends Exception> supplier)
Starting point to the Try structure.
|
abstract Try<T> |
Try.peek(ThrowingConsumer<? super T,? extends Exception> consumer)
Same as forEach but returns the Try for further chaining
|
Try<T> |
Success.peek(ThrowingConsumer<? super T,? extends Exception> consumer) |
Try<T> |
Failure.peek(ThrowingConsumer<? super T,? extends Exception> 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) |
static <T> Try<List<T>> |
Try.sequence(List<Try<T>> tries)
Creates one Try from a list of tries containing the same type, or the _first_ failure in the given list
|
| Modifier and Type | Method and Description |
|---|---|
abstract Optional<Try<T>> |
Try.filter(Predicate<T> predicate)
Applies a filter, where a match returns Success and Failure otherwise.
|
Optional<Try<T>> |
Success.filter(Predicate<T> predicate) |
Optional<Try<T>> |
Failure.filter(Predicate<T> predicate) |
| Modifier and Type | Method and Description |
|---|---|
abstract <U> Try<U> |
Try.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Exception> mapper)
Applies a function on two values.
|
<U> Try<U> |
Success.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Exception> mapper) |
<U> Try<U> |
Failure.flatMap(ThrowingFunction<? super T,? extends Try<U>,? extends Exception> mapper) |
static <T> Try<List<T>> |
Try.sequence(List<Try<T>> tries)
Creates one Try from a list of tries containing the same type, or the _first_ failure in the given list
|
Copyright © 2014–2016. All rights reserved.