java.lang.Object
com.winterhavenmc.library.messagebuilder.keys.AbstractKey
com.winterhavenmc.library.messagebuilder.keys.RecordKey
All Implemented Interfaces:
StandardKey

public final class RecordKey extends AbstractKey implements 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.
  • Method Details

    • of

      public static Optional<RecordKey> of(String key)
      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

      public static <E extends Enum<E>> Optional<RecordKey> of(E key)
      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