Class AbstractAttributable

java.lang.Object
me.eddie.inventoryguiapi.gui.session.AbstractAttributable
All Implemented Interfaces:
Attributable
Direct Known Subclasses:
GUIState, InventoryState

public abstract class AbstractAttributable extends Object implements Attributable
A simple implementation of the Attributable interface that uses a hashmap
  • Constructor Details

    • AbstractAttributable

      public AbstractAttributable()
  • Method Details

    • getAttribute

      public Object getAttribute(Object key)
      Description copied from interface: Attributable
      Get the value of an attribute
      Specified by:
      getAttribute in interface Attributable
      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

      public boolean hasAttribute(Object key)
      Description copied from interface: Attributable
      Check if a given attribute exists
      Specified by:
      hasAttribute in interface Attributable
      Parameters:
      key - The key of the attribute
      Returns:
      True if the attribute exists, or False if not
    • putAttribute

      public void putAttribute(Object key, Object value)
      Description copied from interface: Attributable
      Set the value of an attribute key/value pair
      Specified by:
      putAttribute in interface Attributable
      Parameters:
      key - The key of the attribute key/value pair
      value - The value of the attribute
    • removeAttribute

      public Object removeAttribute(Object key)
      Description copied from interface: Attributable
      Remove an attribute for the given key
      Specified by:
      removeAttribute in interface Attributable
      Parameters:
      key - The key to remove the attribute for
      Returns:
      The previous value for this attribute (before removal) or null