T
- component type of this Failurepublic static final class Try.Failure<T> extends Object implements Try<T>, Serializable
Try.Failure<T>, Try.Success<T>, Try.WithResources1<T1 extends AutoCloseable>, Try.WithResources2<T1 extends AutoCloseable,T2 extends AutoCloseable>, Try.WithResources3<T1 extends AutoCloseable,T2 extends AutoCloseable,T3 extends AutoCloseable>, Try.WithResources4<T1 extends AutoCloseable,T2 extends AutoCloseable,T3 extends AutoCloseable,T4 extends AutoCloseable>, Try.WithResources5<T1 extends AutoCloseable,T2 extends AutoCloseable,T3 extends AutoCloseable,T4 extends AutoCloseable,T5 extends AutoCloseable>, Try.WithResources6<T1 extends AutoCloseable,T2 extends AutoCloseable,T3 extends AutoCloseable,T4 extends AutoCloseable,T5 extends AutoCloseable,T6 extends AutoCloseable>, Try.WithResources7<T1 extends AutoCloseable,T2 extends AutoCloseable,T3 extends AutoCloseable,T4 extends AutoCloseable,T5 extends AutoCloseable,T6 extends AutoCloseable,T7 extends AutoCloseable>, Try.WithResources8<T1 extends AutoCloseable,T2 extends AutoCloseable,T3 extends AutoCloseable,T4 extends AutoCloseable,T5 extends AutoCloseable,T6 extends AutoCloseable,T7 extends AutoCloseable,T8 extends AutoCloseable>
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Clarifies that values have a proper equals() method implemented.
|
T |
get()
Gets the result of this Try if this is a
Success or throws if this is a Failure . |
Throwable |
getCause()
Gets the cause if this is a Failure or throws if this is a Success.
|
int |
hashCode()
Clarifies that values have a proper hashCode() method implemented.
|
boolean |
isEmpty()
Checks whether this Try has no result, i.e.
|
boolean |
isFailure()
Checks if this is a Failure.
|
boolean |
isSuccess()
Checks if this is a Success.
|
String |
stringPrefix()
Returns the name of this Value type, which is used by toString().
|
String |
toString()
Clarifies that values have a proper toString() method implemented.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
andFinally, andFinallyTry, andThen, andThen, andThenTry, andThenTry, collect, failed, failure, filter, filter, filter, filterTry, filterTry, filterTry, flatMap, flatMapTry, fold, getOrElseGet, getOrElseThrow, isAsync, isLazy, isSingleValued, iterator, map, mapFailure, mapTry, narrow, of, ofCallable, ofSupplier, onFailure, onFailure, onSuccess, orElse, orElse, orElseRun, peek, recover, recover, recover, recoverWith, recoverWith, recoverWith, run, runRunnable, sequence, success, toEither, toValidation, toValidation, transform, traverse, withResources, withResources, withResources, withResources, withResources, withResources, withResources, withResources
collect, collect, contains, corresponds, eq, exists, forAll, forEach, getOrElse, getOrElse, getOrElseThrow, getOrElseTry, getOrNull, narrow, out, out, spliterator, stderr, stdout, toArray, toCharSeq, toCompletableFuture, toEither, toEither, toInvalid, toInvalid, toJavaArray, toJavaArray, toJavaArray, toJavaCollection, toJavaList, toJavaList, toJavaMap, toJavaMap, toJavaMap, toJavaOptional, toJavaParallelStream, toJavaSet, toJavaSet, toJavaStream, toLeft, toLeft, toLinkedMap, toLinkedMap, toLinkedSet, toList, toMap, toMap, toOption, toPriorityQueue, toPriorityQueue, toQueue, toRight, toRight, toSet, toSortedMap, toSortedMap, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toStream, toTree, toTree, toTry, toTry, toValid, toValid, toValidation, toValidation, toVector
public T get()
Try
Success
or throws if this is a Failure
.
IMPORTANT! If this is a Try.Failure
, the underlying cause
of type Throwable
is thrown.
The thrown exception is exactly the same as the result of Try.getCause()
.
public Throwable getCause()
Try
public boolean isEmpty()
Try
public boolean isFailure()
Try
public boolean isSuccess()
Try
public boolean equals(Object obj)
Value
public String stringPrefix()
Value
stringPrefix
in interface Value<T>
public int hashCode()
Value
See Object.hashCode().
public String toString()
Value
See Object.toString().
Copyright © 2019. All Rights Reserved.