Modifier and Type | Class and Description |
---|---|
class |
Failure<T>
Represents the 'failed' implementation of
Try . |
class |
Success<T>
Represents the 'successful' implementation of
Try . |
Modifier and Type | Method and Description |
---|---|
static <T> Try<T> |
Try.apply(T value)
|
Try<Throwable> |
Success.failed()
Always returns a
Failure with an UnsupportedOperationException . |
Try<Throwable> |
Try.failed()
|
Try<Throwable> |
Failure.failed()
|
<R> Try<R> |
Success.map(java.util.function.Function<T,R> function)
Applies the value to the function and returns the Try representing the mapped value.
|
<R> Try<R> |
Try.map(java.util.function.Function<T,R> function)
|
<R> Try<R> |
Failure.map(java.util.function.Function<T,R> function)
Always returns
this |
Try<T> |
Success.orElse(java.util.function.Supplier<Try<T>> s)
Always returns this.
|
Try<T> |
Try.orElse(java.util.function.Supplier<Try<T>> supplier)
|
Try<T> |
Failure.orElse(java.util.function.Supplier<Try<T>> s)
Always returns the provided default value.
|
Modifier and Type | Method and Description |
---|---|
Try<T> |
Success.orElse(java.util.function.Supplier<Try<T>> s)
Always returns this.
|
Try<T> |
Try.orElse(java.util.function.Supplier<Try<T>> supplier)
|
Try<T> |
Failure.orElse(java.util.function.Supplier<Try<T>> s)
Always returns the provided default value.
|
Copyright © 2015. All rights reserved.