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 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
-
Method Details
-
getAttribute
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
Check if a given attribute exists- Parameters:
key- The key of the attribute- Returns:
- True if the attribute exists, or False if not
-
putAttribute
Set the value of an attribute key/value pair- Parameters:
key- The key of the attribute key/value pairvalue- The value of the attribute
-
removeAttribute
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
-