Record Class Result.Err<Value,Error>
java.lang.Object
java.lang.Record
codes.domix.fun.Result.Err<Value,Error>
- Type Parameters:
Value- the type of the value contained in a successful result, unused hereError- the type of the error contained in the erroneous result- Record Components:
error- the non-null error value that represents the erroneous result; passingnullthrowsNullPointerException
- All Implemented Interfaces:
Result<Value,Error>
public static record Result.Err<Value,Error> (Error error)
extends Record
implements Result<Value,Error>
Represents an erroneous result containing an error of type
Error.
This record implements the Result interface and represents the "Err" variant
of a result. It encapsulates an error value that indicates a failed computation or action.
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Err
Compact canonical constructor — validates thaterroris non-null.- Throws:
NullPointerException- iferrorisnull
-
-
Method Details
-
toString
-
hashCode
-
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). -
error
-