Class AbstractAttributable
java.lang.Object
me.eddie.inventoryguiapi.gui.session.AbstractAttributable
- All Implemented Interfaces:
Attributable
- Direct Known Subclasses:
GUIState,InventoryState
A simple implementation of the Attributable interface that uses a hashmap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(Object key) Get the value of an attributebooleanhasAttribute(Object key) Check if a given attribute existsvoidputAttribute(Object key, Object value) Set the value of an attribute key/value pairremoveAttribute(Object key) Remove an attribute for the given key
-
Constructor Details
-
AbstractAttributable
public AbstractAttributable()
-
-
Method Details
-
getAttribute
Description copied from interface:AttributableGet the value of an attribute- Specified by:
getAttributein interfaceAttributable- 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
Description copied from interface:AttributableCheck if a given attribute exists- Specified by:
hasAttributein interfaceAttributable- Parameters:
key- The key of the attribute- Returns:
- True if the attribute exists, or False if not
-
putAttribute
Description copied from interface:AttributableSet the value of an attribute key/value pair- Specified by:
putAttributein interfaceAttributable- Parameters:
key- The key of the attribute key/value pairvalue- The value of the attribute
-
removeAttribute
Description copied from interface:AttributableRemove an attribute for the given key- Specified by:
removeAttributein interfaceAttributable- Parameters:
key- The key to remove the attribute for- Returns:
- The previous value for this attribute (before removal) or null
-