Module org.jpo

Class Category

java.lang.Object
org.jpo.datamodel.Category
All Implemented Interfaces:
Serializable

public class Category extends Object implements Serializable
A class which represents a Category
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    This status represents the category being both selected and unselected at the same time used for situations where we have more than one category selected at a time
    static final int
    This status represents the category as being selected
    static final int
    this status represents the category as being unselected
    static final int
    This status represents the category as being in undefined state
  • Constructor Summary

    Constructors
    Constructor
    Description
    Category(Integer key, String value)
    Constructs a new category for the key and value
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the key of the Category
    int
    Call this method to find out if the Category is selected
    Returns the value of the Category
    void
    Sets the key of the Category
    void
    setStatus(int newState)
    Call this method to set the state of the Category to selected or not selected.
    void
    Sets the value of the Category
    Returns the value of the Category.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • UNDEFINED

      public static final int UNDEFINED
      This status represents the category as being in undefined state
      See Also:
    • SELECTED

      public static final int SELECTED
      This status represents the category as being selected
      See Also:
    • UN_SELECTED

      public static final int UN_SELECTED
      this status represents the category as being unselected
      See Also:
    • BOTH

      public static final int BOTH
      This status represents the category being both selected and unselected at the same time used for situations where we have more than one category selected at a time
      See Also:
  • Constructor Details

    • Category

      public Category(Integer key, String value)
      Constructs a new category for the key and value
      Parameters:
      key - The numeric key for the category
      value - the value
  • Method Details

    • getKey

      public Integer getKey()
      Returns the key of the Category
      Returns:
      They key of the Category
    • setKey

      public void setKey(Integer key)
      Sets the key of the Category
      Parameters:
      key - The new key
    • setStatus

      public void setStatus(int newState)
      Call this method to set the state of the Category to selected or not selected.
      Parameters:
      newState - The new state
    • getStatus

      public int getStatus()
      Call this method to find out if the Category is selected
      Returns:
      true if it is selected, false if it is not selected or partially selected
    • getValue

      public String getValue()
      Returns the value of the Category
      Returns:
      They value of the Category
    • setValue

      public void setValue(String value)
      Sets the value of the Category
      Parameters:
      value - The new value
    • toString

      public String toString()
      Returns the value of the Category.
      Overrides:
      toString in class Object
      Returns:
      the value of the Category