Class LabelValue

java.lang.Object
jmt.framework.data.LabelValue

public class LabelValue extends Object

Name: LabelValue

Description: A simple immutable label-value pair

Date: 2014-07-20

Version:
1.0
Author:
Bertoli Marco
  • Constructor Details

    • LabelValue

      public LabelValue(String label, String value)
      Builds a label value with the given label and value
      Parameters:
      label - the label
      value - the value
    • LabelValue

      public LabelValue(String value)
      Builds a label value with the given value used as label too
      Parameters:
      value - the value and label
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • clone

      public LabelValue clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLabel

      public String getLabel()
      Returns the label.
      Returns:
      the label
    • getValue

      public String getValue()
      Returns the value.
      Returns:
      the value
    • getElement

      public static LabelValue getElement(LabelValue[] elements, String value)
      Return an element chosen in a list of LabelValue elements
      Parameters:
      elements - the element
      value - the value to search
      Returns:
      the found value or null if not found
    • getElement

      public static LabelValue getElement(Iterable<LabelValue> elements, String value)
      Return an element chosen in a list of LabelValue elements
      Parameters:
      elements - the element
      value - the value to search
      Returns:
      the found value or null if not found