程序包 org.bukkit

类 NamespacedKey

java.lang.Object
org.bukkit.NamespacedKey

public final class NamespacedKey extends Object
Represents a String based key which consists of two components - a namespace and a key. Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens.

Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.

  • 字段详细资料

    • MINECRAFT

      public static final String MINECRAFT
      The namespace representing all inbuilt keys.
      另请参阅:
    • BUKKIT

      public static final String BUKKIT
      The namespace representing all keys generated by Bukkit for backwards compatibility measures.
      另请参阅:
  • 构造器详细资料

    • NamespacedKey

      @Deprecated public NamespacedKey(String namespace, String key)
      已过时。
      should never be used by plugins, for internal use only!!
      Create a key in a specific namespace.
      参数:
      namespace -
      key -
    • NamespacedKey

      public NamespacedKey(Plugin plugin, String key)
      Create a key in the plugin's namespace.
      参数:
      plugin - the plugin to use for the namespace
      key - the key to create
  • 方法详细资料

    • getNamespace

      public String getNamespace()
    • getKey

      public String getKey()
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • randomKey

      @Deprecated public static NamespacedKey randomKey()
      已过时。
      should never be used by plugins, for internal use only!!
      Return a new random key in the BUKKIT namespace.
      返回:
      new key
    • minecraft

      public static NamespacedKey minecraft(String key)
      Get a key in the Minecraft namespace.
      参数:
      key - the key to use
      返回:
      new key in the Minecraft namespace