Class Try.Success<T>
java.lang.Object
io.vavr.control.Try.Success<T>
- Type Parameters:
T- component type of this Success
- All Implemented Interfaces:
Try<T>, Value<T>, Serializable, Iterable<T>
A succeeded Try.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Try
Try.Failure<T>, Try.Success<T>, Try.WithResources1<T1>, Try.WithResources2<T1,T2>, Try.WithResources3<T1, T2, T3>, Try.WithResources4<T1, T2, T3, T4>, Try.WithResources5<T1, T2, T3, T4, T5>, Try.WithResources6<T1, T2, T3, T4, T5, T6>, Try.WithResources7<T1, T2, T3, T4, T5, T6, T7>, Try.WithResources8<T1, T2, T3, T4, T5, T6, T7, T8> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanClarifies that values have a proper equals() method implemented.get()Gets the result of this Try if this is aSuccessor throws if this is aFailure.getCause()Gets the cause if this is a Failure or throws if this is a Success.inthashCode()Clarifies that values have a proper hashCode() method implemented.booleanisEmpty()Checks whether this Try has no result, i.e.booleanChecks if this is a Failure.booleanChecks 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 interface 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, transformMethods inherited from interface 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
value
-
-
Constructor Details
-
Success
-
-
Method Details
-
get
Description copied from interface:TryGets the result of this Try if this is aSuccessor throws if this is aFailure.IMPORTANT! If this is a
Try.Failure, the underlyingcauseof typeThrowableis thrown.The thrown exception is exactly the same as the result of
Try.getCause(). -
getCause
-
isEmpty
-
isFailure
-
isSuccess
-
equals
Description copied from interface:ValueClarifies that values have a proper equals() method implemented. -
hashCode
public int hashCode()Description copied from interface:ValueClarifies that values have a proper hashCode() method implemented.See Object.hashCode().
-
stringPrefix
Description copied from interface:ValueReturns the name of this Value type, which is used by toString().- Specified by:
stringPrefixin interfaceValue<T>- Returns:
- This type name.
-
toString
Description copied from interface:ValueClarifies that values have a proper toString() method implemented.See Object.toString().
-