Class NamespacedId

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

public class NamespacedId extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Creates a new NamespacedId from the String representation.
    Creates a new NamespacedId from the full String representation, with the / separating the namespace and the key.
    Gets the key portion of the NamespacedId, which is the semantic name for the instance of the type, such as the skill name.
    Gets the namespace portion of the NamespacedId, usually a plugin name in lowercase.
    int
     
    of(String namespace, String key)
    Creates a new NamespacedId from a given namespace and key.
    Returns the full String representation of the NamespacedId, with a / separating the namespace and the key.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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
    • 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
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object