Class RecordKey
java.lang.Object
com.winterhavenmc.library.messagebuilder.keys.AbstractKey
com.winterhavenmc.library.messagebuilder.keys.RecordKey
- All Implemented Interfaces:
StandardKey
A type that represents a validated key for a record. This type guarantees a valid key that has been
validated upon creation. The static factory methods return an Optional of the RecordKey,
or an empty Optional if the parameter was invalid, as determined by regex pattern and Predicate.
-
Field Summary
Fields inherited from class com.winterhavenmc.library.messagebuilder.keys.AbstractKey
IS_INVALID_KEY, VALID_KEY, wrappedString
-
Method Summary
Methods inherited from class com.winterhavenmc.library.messagebuilder.keys.AbstractKey
equals, hashCode, toString
-
Method Details
-
of
Static factory method for instantiating a record key from a string- Parameters:
key
- a String to be used in the creation of a record key- Returns:
- an Optional RecordKey, or an empty Optional if the key parameter is null or invalid
-
of
Static factory method for instantiating a record key from an enum constant- Type Parameters:
E
- an enum constant- Parameters:
key
- an enum constant whose name is used to create a record key- Returns:
- an Optional RecordKey, or an empty Optional if the key parameter is null or invalid
-