Package de.Keyle.MyPet.api.gui
Record Class CustomSection
java.lang.Object
java.lang.Record
de.Keyle.MyPet.api.gui.CustomSection
- Record Components:
id- this section's id within its menutype- the registered type handle this section was decoded asraw- the section's JSON payload, for its own codec to interpret
- All Implemented Interfaces:
Section
public record CustomSection(String id, SectionType<CustomSection> type, JsonObject raw)
extends Record
implements Section
Generic carrier for sections whose type is registered at runtime (e.g. a `value-bar`
widget). The codec for the registered type decodes/encodes
raw into a
concrete record from its own package and stores a strongly-typed view inside
MenuDefinition as needed; the carrier itself just holds the parsed JSON
payload and the type handle until then.-
Constructor Summary
ConstructorsConstructorDescriptionCustomSection(String id, SectionType<CustomSection> type, JsonObject raw) Rejects an absent payload. -
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.id()Returns the value of theidrecord component.raw()Returns the value of therawrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
CustomSection
Rejects an absent payload.
-
-
Method Details
-
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). -
id
Returns the value of theidrecord component. -
type
Returns the value of thetyperecord component. -
raw
Returns the value of therawrecord component.- Returns:
- the value of the
rawrecord component
-