Record Class InvalidItemRecord
java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.models.language.InvalidItemRecord
- Record Components:
key- theValidItemKeythat could not be resolvedreason- an explanation of why the record is invalid (e.g., missing section)
- All Implemented Interfaces:
ItemRecord,SectionRecord
public record InvalidItemRecord(RecordKey key, InvalidRecordReason reason)
extends Record
implements ItemRecord
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(LegacyRecordKey, 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.models.language.ItemRecord
ItemRecord.Field -
Constructor Summary
ConstructorsConstructorDescriptionInvalidItemRecord(RecordKey key, InvalidRecordReason reason) Creates an instance of aInvalidItemRecordrecord class. -
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.key()Returns the value of thekeyrecord component.reason()Returns the value of thereasonrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.winterhavenmc.library.messagebuilder.models.language.ItemRecord
isValid
-
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 thekeyrecord component.- Specified by:
keyin interfaceSectionRecord- Returns:
- the value of the
keyrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-