Class KeyNamePair

java.lang.Object
org.compiere.util.NamePair
org.compiere.util.KeyNamePair
All Implemented Interfaces:
Serializable, Comparable<Object>, Comparator<Object>

public final class KeyNamePair extends NamePair
Key Name Pair (Integer key and string name)
Version:
$Id: KeyNamePair.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
Author:
Jorg Janke
See Also:
  • Field Details

  • Constructor Details

    • KeyNamePair

      public KeyNamePair(int key, String name)
      Constructor KeyNamePair Pair -
      Parameters:
      key - Key (-1 is considered as null)
      name - string representation
  • Method Details

    • getKey

      public int getKey()
      Get Key
      Returns:
      key
    • getID

      public String getID()
      Get ID (convert key to string)
      Specified by:
      getID in class NamePair
      Returns:
      String value of key or null if key value is -1
    • equals

      public boolean equals(Object obj)
      Equals
      Specified by:
      equals in interface Comparator<Object>
      Overrides:
      equals in class Object
      Parameters:
      obj - object
      Returns:
      true if equal
    • hashCode

      public int hashCode()
      Return key as hash code of object
      Overrides:
      hashCode in class Object
      Returns:
      key value