Record Class DataTypeField.OptionalField<C,T>
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.data.DataTypeField.OptionalField<C,T>
- All Implemented Interfaces:
DataTypeField<C, Optional<T>>
- Enclosing interface:
DataTypeField<C,T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface DataTypeField
DataTypeField.OptionalDefaultField<C,T>, DataTypeField.OptionalField<C, T>, DataTypeField.RequiredField<C, T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandecode(com.mojang.serialization.DynamicOps<O> ops, O value) decode(io.netty.buffer.ByteBuf buf, boolean present) <O> voidencode(com.mojang.serialization.DynamicOps<O> ops, com.mojang.serialization.RecordBuilder<O> builder, Optional<T> value) voidfinal booleanIndicates whether some other object is "equal to" this one.getter()Returns the value of thegetterrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.booleanshouldEncode(Optional<T> value) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
OptionalField
-
-
Method Details
-
typeClass
-
get
-
canBeOptional
public boolean canBeOptional()- Specified by:
canBeOptionalin interfaceDataTypeField<C,T>
-
shouldEncode
- Specified by:
shouldEncodein interfaceDataTypeField<C,T>
-
encode
-
decode
-
encode
-
decode
-
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). -
type
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceDataTypeField<C,T> - Returns:
- the value of the
namerecord component
-
getter
-