Package com.io7m.cedarbridge.runtime.api
Record Class CBSome<T extends CBSerializableType>
java.lang.Object
java.lang.Record
com.io7m.cedarbridge.runtime.api.CBSome<T>
- Type Parameters:
T- The type of values- Record Components:
value- The present value
- All Implemented Interfaces:
CBOptionType<T>,CBSerializableType,Formattable
public record CBSome<T extends CBSerializableType>(T extends CBSerializableType value)
extends Record
implements CBOptionType<T>
The Some case.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidfinal inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
CBSome
The Some case.- Parameters:
value- The present value
-
-
Method Details
-
formatTo
- Specified by:
formatToin interfaceFormattable
-
asOptional
- Specified by:
asOptionalin interfaceCBOptionType<T extends CBSerializableType>- Returns:
- This value as a Java Optional
-
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
-