Class MenuState<T>
java.lang.Object
com.thecoderscorner.menu.domain.state.MenuState<T>
- Type Parameters:
T- the type of current value.
- All Implemented Interfaces:
AnyMenuState
- Direct Known Subclasses:
BigDecimalMenuState,BooleanMenuState,CurrentScrollPositionMenuState,FloatMenuState,IntegerMenuState,PortableColorMenuState,StringListMenuState,StringMenuState
The base class of menu state, stores the value, if it's active and changed.
Generally it's best to work with state via
MenuItemHelper-
Nested Class Summary
Nested classes/interfaces inherited from interface com.thecoderscorner.menu.domain.state.AnyMenuState
AnyMenuState.StateStorageType -
Constructor Summary
ConstructorsConstructorDescriptionMenuState(AnyMenuState.StateStorageType storageType, MenuItem item, boolean changed, boolean active, T value) normally these states are created from the menu item, instead of directly -
Method Summary
Modifier and TypeMethodDescriptionbooleangetItem()Gets the menu item associated with this state.The storage type for this state, eg if it is a MenuState specialised for Integer, then the state type will be INTEGER.getValue()gets the current valueinthashCode()booleanisActive()gets the active statusbooleangets the changed status
-
Constructor Details
-
Method Details
-
getItem
Gets the menu item associated with this state.- Specified by:
getItemin interfaceAnyMenuState- Returns:
- the menu item
-
getStorageType
The storage type for this state, eg if it is a MenuState specialised for Integer, then the state type will be INTEGER.- Specified by:
getStorageTypein interfaceAnyMenuState- Returns:
- the storage type
-
isChanged
public boolean isChanged()gets the changed status- Specified by:
isChangedin interfaceAnyMenuState- Returns:
- changed status
-
isActive
public boolean isActive()gets the active status- Specified by:
isActivein interfaceAnyMenuState- Returns:
- active status
-
getValue
gets the current value- Specified by:
getValuein interfaceAnyMenuState- Returns:
- current value
-
equals
-
hashCode
public int hashCode()
-