Class NamespacedId

java.lang.Object
dev.aurelium.auraskills.api.registry.NamespacedId

public class NamespacedId extends Object
  • Field Details

  • Method Details

    • getNamespace

      public String getNamespace()
      Gets the namespace portion of the NamespacedId, usually a plugin name in lowercase.
      Returns:
      the namespace
    • getKey

      public String getKey()
      Gets the key portion of the NamespacedId, which is the semantic name for the instance of the type, such as the skill name.
      Returns:
      the key
    • getSimpleName

      public String getSimpleName()
      Gets the string representation of the ID in the namespace/key format, or just the key if the namespace is the default auraskills namespace.
      Returns:
      the simple name
    • getOriginalKey

      public String getOriginalKey()
      Gets the original key portion of the NamespacedId, which is the key in the case it was created with.
      Returns:
      the original key
    • toString

      public String toString()
      Returns the full String representation of the NamespacedId, with a / separating the namespace and the key.
      Overrides:
      toString in class Object
      Returns:
      the String namespace/key
    • of

      public static NamespacedId of(String namespace, String key)
      Creates a new NamespacedId from a given namespace and key. Both should be in lowercase.
      Parameters:
      namespace - the namespace, usually the name of the plugin calling this method
      key - the key that is the actual name of the instance
      Returns:
      the created NamespacedId
    • fromString

      public static NamespacedId fromString(String string)
      Creates a new NamespacedId from the full String representation, with the / separating the namespace and the key.
      Parameters:
      string - the full String, with the slash separator
      Returns:
      the created NamespacedId
    • fromDefault

      public static NamespacedId fromDefault(String string)
      Creates a new NamespacedId from the String representation. Works the same as fromString(String), but will fall back to using the default auraskills namespace if there is no slash in the input.
      Parameters:
      string - the String input, with or without the slash
      Returns:
      the new NamespacedId
    • fromDefaultWithColon

      public static NamespacedId fromDefaultWithColon(String string)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object