Package com.github.tonivade.purefun.type
Record Class Try.Failure<T>
java.lang.Object
java.lang.Record
com.github.tonivade.purefun.type.Try.Failure<T>
- All Implemented Interfaces:
Applicable<Try<?>,,T> Bindable<Try<?>,,T> Mappable<Try<?>,,T> Recoverable,Kind<Try<?>,,T> Try<T>,TryOf<T>,Serializable
public static record Try.Failure<T>(Throwable cause)
extends Record
implements Try<T>, Recoverable, Serializable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.tonivade.purefun.core.Applicable
Applicable.Map2<F extends Applicable<F,?>, A, B>, Applicable.Map3<F extends Applicable<F, ?>, A, B, C>, Applicable.Map4<F extends Applicable<F, ?>, A, B, C, D>, Applicable.Map5<F extends Applicable<F, ?>, A, B, C, D, E> Nested classes/interfaces inherited from interface com.github.tonivade.purefun.type.Try
Try.Failure<T>, Try.Success<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ThrowableThe field for thecauserecord component.private static final Equal<Try.Failure<?>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncause()Returns the value of thecauserecord component.booleanIndicates whether some other object is "equal to" this one.getCause()private StackTraceElement[]inthashCode()Returns a hash code value for this object.booleanbooleantoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.tonivade.purefun.core.Applicable
zip, zipLeft, zipRight, zipWithMethods inherited from interface com.github.tonivade.purefun.core.Recoverable
sneakyThrowMethods inherited from interface com.github.tonivade.purefun.type.Try
ap, filter, filterNot, filterOrElse, flatMap, fold, getOrElse, getOrElse, getOrElseNull, getOrElseThrow, map, mapError, onFailure, onSuccess, or, orElse, recover, recoverWith, sequence, stream, toEither, toOption, toValidation
-
Field Details
-
cause
The field for thecauserecord component. -
EQUAL
-
-
Constructor Details
-
Failure
Creates an instance of aFailurerecord class.- Parameters:
cause- the value for thecauserecord component
-
-
Method Details
-
isFailure
public boolean isFailure() -
isSuccess
public boolean isSuccess() -
getOrElseThrow
- Specified by:
getOrElseThrowin interfaceTry<T>
-
getCause
-
getMessage
-
getStackTrace
-
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
cause
Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-