Interface Attributable

All Known Implementing Classes:
AbstractAttributable, GUIState, InventoryState

public interface Attributable
Represents an object that attributes can be added to and remove from.
  • Method Details

    • getAttribute

      Object getAttribute(Object key)
      Get the value of an attribute
      Parameters:
      key - The key of the attribute
      Returns:
      The value of the attribute, or null if no value can be found for the given key
    • hasAttribute

      boolean hasAttribute(Object key)
      Check if a given attribute exists
      Parameters:
      key - The key of the attribute
      Returns:
      True if the attribute exists, or False if not
    • putAttribute

      void putAttribute(Object key, Object value)
      Set the value of an attribute key/value pair
      Parameters:
      key - The key of the attribute key/value pair
      value - The value of the attribute
    • removeAttribute

      Object removeAttribute(Object key)
      Remove an attribute for the given key
      Parameters:
      key - The key to remove the attribute for
      Returns:
      The previous value for this attribute (before removal) or null