Record Class InvalidKey
java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.models.keys.InvalidKey
- All Implemented Interfaces:
MacroKey,StandardKey
-
Field Summary
Fields inherited from interface com.winterhavenmc.library.messagebuilder.models.keys.StandardKey
IS_INVALID_KEY, VALID_KEY_PATTERN -
Constructor Summary
ConstructorsConstructorDescriptionInvalidKey(String string, InvalidKeyReason Reason) Creates an instance of aInvalidKeyrecord 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.Reason()Returns the value of theReasonrecord component.string()Returns the value of thestringrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InvalidKey
Creates an instance of aInvalidKeyrecord class.- Parameters:
string- the value for thestringrecord componentReason- the value for theReasonrecord component
-
-
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). -
string
Returns the value of thestringrecord component.- Returns:
- the value of the
stringrecord component
-
Reason
Returns the value of theReasonrecord component.- Returns:
- the value of the
Reasonrecord component
-