Record Class SchemaNode.EitherSchema
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.common.serialization.schema.SchemaNode.EitherSchema
- Record Components:
left- left schemaright- right schema
- All Implemented Interfaces:
SchemaNode
- Enclosing interface:
SchemaNode
public static record SchemaNode.EitherSchema(SchemaNode left, SchemaNode right)
extends Record
implements SchemaNode
Represents a schema that may be one of two types.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.darksoulq.abyssallib.common.serialization.schema.SchemaNode
SchemaNode.DispatchSchema, SchemaNode.EitherSchema, SchemaNode.EnumSchema, SchemaNode.FieldSchema, SchemaNode.ListSchema, SchemaNode.MapSchema, SchemaNode.OneOfSchema, SchemaNode.OptionalSchema, SchemaNode.PrimitiveSchema, SchemaNode.RecordSchema, SchemaNode.TupleSchema, SchemaNode.UnknownSchema -
Constructor Summary
ConstructorsConstructorDescriptionEitherSchema(SchemaNode left, SchemaNode right) Creates an instance of aEitherSchemarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.left()Returns the value of theleftrecord component.right()Returns the value of therightrecord component.<T> Tto(DynamicOps<T> ops) Converts this schema node into a standardized serialized representation using the provided dynamic operations.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
to
Description copied from interface:SchemaNodeConverts this schema node into a standardized serialized representation using the provided dynamic operations.- Specified by:
toin interfaceSchemaNode- Type Parameters:
T- the target output type- Parameters:
ops- the serialization operations provider- Returns:
- the structured representation of this schema
-
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). -
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-