Class MenuState<T>
- java.lang.Object
-
- com.thecoderscorner.menu.domain.state.MenuState<T>
-
- Type Parameters:
T- the type of current value.
- Direct Known Subclasses:
BooleanMenuState,FloatMenuState,IntegerMenuState,StringMenuState
public abstract class MenuState<T> extends java.lang.ObjectThe base class of menu state, stores the value, if it's active and changed.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)TgetValue()gets the current valueinthashCode()booleanisActive()gets the active statusbooleanisChanged()gets the changed status
-
-
-
Constructor Detail
-
MenuState
public MenuState(boolean changed, boolean active, T value)normally these states are created from the menu item, instead of directly- Parameters:
changed- if the item has changedactive- if the item is active.value- the current value
-
-
Method Detail
-
isChanged
public boolean isChanged()
gets the changed status- Returns:
- changed status
-
isActive
public boolean isActive()
gets the active status- Returns:
- active status
-
getValue
public T getValue()
gets the current value- Returns:
- current value
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-