T
- The type of the exception represented by this instancepublic final class Failure<T> extends Object implements Try<T>, Serializable
Try
.Constructor and Description |
---|
Failure(Throwable throwable)
Creates a Failure for the provided Throwable.
Null values are not allowed. |
Modifier and Type | Method and Description |
---|---|
Try<Throwable> |
failed()
|
T |
get()
Always throws the
Throwable provided in the constructor. |
T |
getOrElse(java.util.function.Supplier<T> s)
Always returns the provided default value.
|
boolean |
isSuccess()
Always returns
false . |
<R> Try<R> |
map(java.util.function.Function<T,R> function)
Always returns
this |
Try<T> |
orElse(java.util.function.Supplier<Try<T>> s)
Always returns the provided default value.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
apply, asOption, isFailure, iterator, orNull, stream
forEach, spliterator
public Failure(Throwable throwable)
throwable
- The throwablepublic boolean isSuccess()
false
.public T getOrElse(java.util.function.Supplier<T> s)
public Try<T> orElse(java.util.function.Supplier<Try<T>> s)
public <R> Try<R> map(java.util.function.Function<T,R> function)
this
Copyright © 2015. All rights reserved.