Package io.vavr.control
Class Try.Failure<T>
java.lang.Object
io.vavr.control.Try.Failure<T>
- Type Parameters:
T
- component type of this Failure
- All Implemented Interfaces:
Try<T>
,Value<T>
,Serializable
,Iterable<T>
A failed Try.
- Author:
- Daniel Dietrich
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vavr.control.Try
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> -
Method Summary
Modifier and TypeMethodDescriptionboolean
Clarifies that values have a proper equals() method implemented.get()
Gets the result of this Try if this is aSuccess
or throws if this is aFailure
.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. is a Failure.boolean
Checks if this is a Failure.boolean
Checks if this is a Success.Returns the name of this Value type, which is used by toString().toString()
Clarifies that values have a proper toString() method implemented.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.vavr.control.Try
andFinally, andFinallyTry, andThen, andThen, andThenTry, andThenTry, collect, failed, filter, filter, filter, filterTry, filterTry, filterTry, flatMap, flatMapTry, fold, getOrElseGet, getOrElseThrow, isAsync, isLazy, isSingleValued, iterator, map, mapFailure, mapTry, onFailure, onFailure, onSuccess, orElse, orElse, orElseRun, peek, recover, recover, recover, recoverWith, recoverWith, recoverWith, toEither, toValidation, toValidation, transform
Methods inherited from interface io.vavr.Value
collect, collect, contains, corresponds, eq, exists, forAll, forEach, getOrElse, getOrElse, getOrElseThrow, getOrElseTry, getOrNull, 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
-
Method Details
-
get
Description copied from interface:Try
Gets the result of this Try if this is aSuccess
or throws if this is aFailure
.IMPORTANT! If this is a
Try.Failure
, the underlyingcause
of typeThrowable
is thrown.The thrown exception is exactly the same as the result of
Try.getCause()
. -
getCause
Description copied from interface:Try
Gets the cause if this is a Failure or throws if this is a Success. -
isEmpty
public boolean isEmpty()Description copied from interface:Try
Checks whether this Try has no result, i.e. is a Failure. -
isFailure
public boolean isFailure()Description copied from interface:Try
Checks if this is a Failure. -
isSuccess
public boolean isSuccess()Description copied from interface:Try
Checks if this is a Success. -
equals
Description copied from interface:Value
Clarifies that values have a proper equals() method implemented. -
stringPrefix
Description copied from interface:Value
Returns the name of this Value type, which is used by toString().- Specified by:
stringPrefix
in interfaceValue<T>
- Returns:
- This type name.
-
hashCode
public int hashCode()Description copied from interface:Value
Clarifies that values have a proper hashCode() method implemented.See Object.hashCode().
-
toString
Description copied from interface:Value
Clarifies that values have a proper toString() method implemented.See Object.toString().
-