Record Class InvalidItemRecord
java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.model.language.InvalidItemRecord
- Record Components:
key
- theRecordKey
that could not be resolvedreason
- an explanation of why the record is invalid (e.g., missing section)
- All Implemented Interfaces:
ItemRecord
,SectionRecord
An
ItemRecord
representing a missing or invalid item entry from the
ITEMS
section of a language YAML file.
This record is typically returned by ItemRecord.from(RecordKey, ConfigurationSection)
when the associated configuration section is null
or otherwise unusable.
The reason
field provides a human-readable explanation of the failure,
useful for diagnostics or logging, but is not required for program logic.
This record is safe to pass through all systems in the library, and guarantees
that item-related logic does not throw NullPointerException
due to
missing configurations.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.winterhavenmc.library.messagebuilder.model.language.ItemRecord
ItemRecord.Field
-
Constructor Summary
ConstructorsConstructorDescriptionInvalidItemRecord
(RecordKey key, String reason) Creates an instance of aInvalidItemRecord
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.key()
Returns the value of thekey
record component.reason()
Returns the value of thereason
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
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)
. -
key
Returns the value of thekey
record component.- Specified by:
key
in interfaceSectionRecord
- Returns:
- the value of the
key
record component
-
reason
Returns the value of thereason
record component.- Returns:
- the value of the
reason
record component
-