Record Class InvalidConstantRecord
java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.models.language.InvalidConstantRecord
- Record Components:
key- theConstantKeyidentifying the invalid constantreason- the explanation for why this record is invalid
- All Implemented Interfaces:
ConstantRecord,SectionRecord
public record InvalidConstantRecord(RecordKey key, InvalidRecordReason reason)
extends Record
implements ConstantRecord
A
ConstantRecord representing a missing or invalid constant from the
CONSTANTS section of a language YAML file.
This record is typically returned by ConstantRecord.of(ValidConstantKey, Object)
when a constant entry is null, missing, or otherwise unusable.
The reason field provides a human-readable description of the failure,
which may be useful for debugging, logging, or diagnostics.
This record is safe to return and pass through the message pipeline, and will not result in runtime exceptions when encountered.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInvalidConstantRecord(RecordKey key, InvalidRecordReason reason) Creates an instance of aInvalidConstantRecordrecord 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.
-
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
-