Class AbstractProperty<T>

java.lang.Object
com.sk89q.worldedit.registry.state.AbstractProperty<T>
All Implemented Interfaces:
Property<T>
Direct Known Subclasses:
BooleanProperty, DirectionalProperty, EnumProperty, IntegerProperty

public abstract class AbstractProperty<T> extends Object implements Property<T>
  • Constructor Details

    • AbstractProperty

      public AbstractProperty(String name, List<T> values)
    • AbstractProperty

      public AbstractProperty(String name, List<T> values, int bitOffset)
  • Method Details

    • getKey

      public PropertyKey getKey()
      Description copied from interface: Property
      Get the PropertyKey associated with this property.
      Specified by:
      getKey in interface Property<T>
    • getNumBits

      @Deprecated public int getNumBits()
      Deprecated.
    • getBitOffset

      @Deprecated public int getBitOffset()
      Deprecated.
    • getBitMask

      @Deprecated public int getBitMask()
      Deprecated.
    • withOffset

      public abstract <C extends AbstractProperty<T>> C withOffset(int bitOffset)
    • modify

      @Deprecated public int modify(int state, T value)
      Deprecated.
    • modifyIndex

      public int modifyIndex(int state, int index)
    • getValue

      public T getValue(int state)
    • getIndex

      public int getIndex(int state)
    • getValues

      public List<T> getValues()
      Description copied from interface: Property
      Return a list of available values for this state.
      Specified by:
      getValues in interface Property<T>
      Returns:
      the list of state values
    • toString

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getName

      public String getName()
      Description copied from interface: Property
      Returns the name of this state.
      Specified by:
      getName in interface Property<T>
      Returns:
      The state name
    • getValueFor

      @Nullable public T getValueFor(String string) throws IllegalArgumentException
      Description copied from interface: Property
      Gets the value for the given string, or null.
      Specified by:
      getValueFor in interface Property<T>
      Parameters:
      string - The string
      Returns:
      The value, or null
      Throws:
      IllegalArgumentException - When the value is invalid.
    • setName

      public void setName(String name)
      Internal method for name setting post-deserialise. Do not use.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object