Class Registry<V extends Keyed>

java.lang.Object
com.sk89q.worldedit.registry.Registry<V>
All Implemented Interfaces:
Keyed, Iterable<V>
Direct Known Subclasses:
NamespacedRegistry

public class Registry<V extends Keyed> extends Object implements Iterable<V>, Keyed
  • Field Details

  • Constructor Details

    • Registry

      @Deprecated public Registry(String name)
      Deprecated.
      Use Registry(String, String) instead to provide an ID
      Creates a new Registry.
      Parameters:
      name - The name of the registry
    • Registry

      @Deprecated public Registry(String name, boolean checkInitialized)
      Deprecated.
      Use Registry(String, String, boolean) instead to provide an ID
      Creates a new Registry.
      Parameters:
      name - The name of the registry
      checkInitialized - Whether to check if WorldEdit is initialized
    • Registry

      public Registry(String name, String id)
      Creates a new Registry.
      Parameters:
      name - The name of the registry
      id - The ID of the registry
    • Registry

      public Registry(String name, String id, boolean checkInitialized)
      Creates a new Registry.
      Parameters:
      name - The name of the registry
      id - The ID of the registry
      checkInitialized - Whether to check if WorldEdit is initialized
  • Method Details

    • getName

      public String getName()
    • id

      public String id()
      Description copied from interface: Keyed
      The id of this object in the registry. Must be unique and lowercase. Certain registries (e.g namespaced ones) may have additional restrictions.
      Specified by:
      id in interface Keyed
      Returns:
      an id
    • getMap

      public Map<String,V> getMap()
    • get

      @Nullable public V get(String key)
    • register

      public V register(String key, V value)
    • clear

      public void clear()
    • keySet

      public Set<String> keySet()
    • values

      public Collection<V> values()
    • iterator

      public Iterator<V> iterator()
      Specified by:
      iterator in interface Iterable<V extends Keyed>