Package com.github.tonivade.purefun.type
Record Class Try.Success<T>
java.lang.Object
java.lang.Record
com.github.tonivade.purefun.type.Try.Success<T>
- All Implemented Interfaces:
Applicable<Try<?>,,T> Bindable<Try<?>,,T> Mappable<Try<?>,,T> Kind<Try<?>,,T> Try<T>,TryOf<T>,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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getCause()final inthashCode()Returns a hash code value for this object.booleanbooleantoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.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.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
-
value
The field for thevaluerecord component.
-
-
Constructor Details
-
Success
Creates an instance of aSuccessrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
isFailure
public boolean isFailure() -
isSuccess
public boolean isSuccess() -
getOrElseThrow
- Specified by:
getOrElseThrowin interfaceTry<T>
-
getCause
-
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. -
hashCode
public final 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). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-