Record Class InvalidConstantRecord
java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.model.language.InvalidConstantRecord
- Record Components:
key
- theRecordKey
identifying the invalid constantreason
- the explanation for why this record is invalid
- All Implemented Interfaces:
ConstantRecord
,SectionRecord
public record InvalidConstantRecord(RecordKey key, String 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.from(RecordKey, 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, String reason) Creates an instance of aInvalidConstantRecord
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
-