Record Class SchemaNode.FieldSchema
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.common.serialization.schema.SchemaNode.FieldSchema
- Record Components:
name- field nametype- field schemaoptional- whether the field is optionaldefaultValue- default value for the fielddescription- field description
- Enclosing interface:
SchemaNode
public static record SchemaNode.FieldSchema(String name, SchemaNode type, boolean optional, Object defaultValue, String description)
extends Record
Describes a field within a record schema.
-
Constructor Summary
ConstructorsConstructorDescriptionFieldSchema(String name, SchemaNode type, boolean optional, Object defaultValue, String description) Creates an instance of aFieldSchemarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedefaultValuerecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.booleanoptional()Returns the value of theoptionalrecord component.<T> Tto(DynamicOps<T> ops) Converts this field schema into a structural representation.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
FieldSchema
public FieldSchema(String name, SchemaNode type, boolean optional, Object defaultValue, String description) Creates an instance of aFieldSchemarecord class.- Parameters:
name- the value for thenamerecord componenttype- the value for thetyperecord componentoptional- the value for theoptionalrecord componentdefaultValue- the value for thedefaultValuerecord componentdescription- the value for thedescriptionrecord component
-
-
Method Details
-
to
Converts this field schema into a structural representation.- Type Parameters:
T- the target output type- Parameters:
ops- the serialization operations provider- Returns:
- the serialized field
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
type
-
optional
-
defaultValue
Returns the value of thedefaultValuerecord component.- Returns:
- the value of the
defaultValuerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-