Class Key<C extends Concept>

java.lang.Object
org.midheaven.keys.Key<C>

public abstract class Key<C extends Concept> extends Object
  • Constructor Details

    • Key

      protected Key()
  • Method Details

    • of

      public static <K extends Concept> Key<K> of(Class<K> concept, String value)
      Creates an instance from the provided value.
      Parameters:
      concept - the concept value
      value - the value value
      Returns:
      the result of of
    • of

      public static <K extends Concept> Key<K> of(Class<K> concept, long value)
      Creates an instance from the provided value.
      Parameters:
      concept - the concept value
      value - the value value
      Returns:
      the result of of
    • of

      public static <K extends Concept> Key<K> of(Class<K> concept, UUID value)
      Creates an instance from the provided value.
      Parameters:
      concept - the concept value
      value - the value value
      Returns:
      the result of of
    • compose

      public static <K extends Concept> Key<K> compose(String conceptName, Object value)
      Performs compose.
      Parameters:
      conceptName - the conceptName value
      value - the value value
      Returns:
      the result of compose
    • parse

      public static <K extends Concept> Key<K> parse(String textualRepresentation)
      Parses the provided value.
      Parameters:
      textualRepresentation - the textualRepresentation value
      Returns:
      the result of parse
    • tryParse

      public static <K extends Concept> Maybe<Key<K>> tryParse(String textualRepresentation)
      Performs tryParse.
      Parameters:
      textualRepresentation - the textualRepresentation value
      Returns:
      the result of tryParse
    • ensureConcept

      public <C extends Concept> Key<C> ensureConcept(Class<C> concept)
      Performs ensureConcept.
      Parameters:
      concept - the concept value
      Returns:
      the result of ensureConcept
    • conceptName

      public abstract String conceptName()
      Performs conceptName.
      Returns:
      the result of conceptName
    • stringValue

      public abstract String stringValue()
      Performs stringValue.
      Returns:
      the result of stringValue
    • longValue

      public abstract long longValue()
      Performs longValue.
      Returns:
      the result of longValue
    • uuidValue

      public abstract UUID uuidValue()
      Performs uuidValue.
      Returns:
      the result of uuidValue
    • value

      public abstract Object value()
      Performs value.
      Returns:
      the result of value
    • hashCode

      public int hashCode()
      Checks whether hash Code.
      Overrides:
      hashCode in class Object
      Returns:
      the result of hashCode
    • equals

      public boolean equals(Object other)
      Performs equals.
      Overrides:
      equals in class Object
      Parameters:
      other - the other value
      Returns:
      the result of equals
    • toString

      public String toString()
      Returns to String.
      Overrides:
      toString in class Object
      Returns:
      the result of toString