java.lang.Object
com.thecoderscorner.menu.domain.state.MenuState<T>
Type Parameters:
T - the type of current value.
Direct Known Subclasses:
BigDecimalMenuState, BooleanMenuState, CurrentScrollPositionMenuState, FloatMenuState, IntegerMenuState, PortableColorMenuState, StringListMenuState, StringMenuState

public abstract class MenuState<T> extends Object
The base class of menu state, stores the value, if it's active and changed.
  • Constructor Details

    • MenuState

      public MenuState(MenuItem<T> item, boolean changed, boolean active, T value)
      normally these states are created from the menu item, instead of directly
      Parameters:
      changed - if the item has changed
      active - if the item is active.
      value - the current value
  • Method Details

    • getItem

      public MenuItem<T> getItem()
      Gets the menu item associated with this state.
      Returns:
      the menu item
    • 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(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object