Class Namespace

java.lang.Object
org.kingdoms.constants.namespace.Namespace

public class Namespace extends Object
A container that namespaces values for registration to avoid conflicts. These values are usually registered inside of a NamespaceRegistry

Extending this class is usually not a good idea. The NamespaceContainer should be used instead.

  • Field Details

  • Constructor Details

    • Namespace

      public Namespace(@NonNull String namespace, @NonNull String key)
  • Method Details

    • getConfigOptionName

      public String getConfigOptionName()
      Returns:
      returns a asNormalizedString() except that the key is replaced with all lowercase letters and underscores replaced with dashes.
    • asString

      public final String asString()
      This is not intended for data usage, you should use asNormalizedString() instead if you're saving data.
      Returns:
      getNamespace() + ':' + getKey()
    • asNormalizedString

      public final String asNormalizedString()
      If this is a kingdoms name spaces, gives back the getKey() otherwise, it gives back asString()
    • kingdoms

      public static Namespace kingdoms(String key)
      This method is only intended to be used by Kingdoms only.
    • getNamespace

      public final @NonNull String getNamespace()
    • getKey

      public final @NonNull String getKey()
    • fromString

      public static @NonNull Namespace fromString(String str)
      Parses a string with the format of asNormalizedString()
    • fromConfigString

      public static Namespace fromConfigString(String str)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object