Record Class SchemaNode.DispatchSchema
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.common.serialization.schema.SchemaNode.DispatchSchema
- Record Components:
discriminator- field used to select a variantvariants- available schema variants
- All Implemented Interfaces:
SchemaNode
- Enclosing interface:
SchemaNode
public static record SchemaNode.DispatchSchema(String discriminator, Map<String, SchemaNode> variants)
extends Record
implements SchemaNode
Represents a polymorphic schema selected by a discriminator field.
-
Nested Class Summary
Nested classes/interfaces inherited from interface 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
ConstructorsConstructorDescriptionDispatchSchema(String discriminator, Map<String, SchemaNode> variants) Creates an instance of aDispatchSchemarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thediscriminatorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.<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.variants()Returns the value of thevariantsrecord component.
-
Constructor Details
-
DispatchSchema
Creates an instance of aDispatchSchemarecord class.- Parameters:
discriminator- the value for thediscriminatorrecord componentvariants- the value for thevariantsrecord component
-
-
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
-
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). -
discriminator
Returns the value of thediscriminatorrecord component.- Returns:
- the value of the
discriminatorrecord component
-
variants
-