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 TypeMethodDescriptionstatic <T extends CBSerializableType>
CBSome<T> deserialize(CBSerializationContextType context, CBDeserializeType<T> ft) Deserialize the given value.final booleanIndicates whether some other object is "equal to" this one.voidfinal inthashCode()Returns a hash code value for this object.static <T extends CBSerializableType>
voidserialize(CBSerializationContextType context, CBSome<T> x, CBSerializeType<T> ft) Serialize the given value.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
CBSome
-
-
Method Details
-
formatTo
- Specified by:
formatToin interfaceFormattable
-
asOptional
- Specified by:
asOptionalin interfaceCBOptionType<T extends CBSerializableType>- Returns:
- This value as a Java Optional
-
serialize
public static <T extends CBSerializableType> void serialize(CBSerializationContextType context, CBSome<T> x, CBSerializeType<T> ft) throws IOException Serialize the given value.- Type Parameters:
T- The type of list values- Parameters:
context- The serialization contextx- The valueft- A serializer forT- Throws:
IOException- On errors
-
deserialize
public static <T extends CBSerializableType> CBSome<T> deserialize(CBSerializationContextType context, CBDeserializeType<T> ft) throws IOException Deserialize the given value.- Parameters:
context- The serialization context- Returns:
- The deserialized value
- Throws:
IOException- On errors
-
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). -
value
-