org.bsf.listOfValues.lovValue
Class DefaultLovValue

java.lang.Object
  extended byorg.bsf.listOfValues.lovValue.DefaultLovValue
All Implemented Interfaces:
LovValue, java.io.Serializable

public class DefaultLovValue
extends java.lang.Object
implements LovValue

A default implementation of the LovValue interface. It represents a row of a list of values.

See Also:
LovValue, Serialized Form

Field Summary
protected  java.util.HashMap _fields
           
protected  java.lang.Object _pk
           
static java.lang.String FIELD_SEPARATOR
           
 
Constructor Summary
DefaultLovValue(java.lang.Object p_pk)
           
 
Method Summary
 void addField(java.lang.String p_fieldName, java.lang.Object p_fieldValue)
          It will replace any previous value with the same field name.
 boolean equals(java.lang.Object p_lovValue)
           
 java.lang.Object getFieldValue(java.lang.String p_fieldName)
          This method enable the access to the values stored in this LovValue for the given field name.
 java.lang.Long getOid()
          Deprecated. should use getPK()
 java.lang.Object getPK()
          This method should be use instead of the old getOid() method.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIELD_SEPARATOR

public static final java.lang.String FIELD_SEPARATOR
See Also:
Constant Field Values

_pk

protected java.lang.Object _pk

_fields

protected java.util.HashMap _fields
Constructor Detail

DefaultLovValue

public DefaultLovValue(java.lang.Object p_pk)
Method Detail

getOid

public java.lang.Long getOid()
Deprecated. should use getPK()

This method is deprecated but should keep working as long as the first column returned is a Long.

Specified by:
getOid in interface LovValue
Returns:
The oid of this particular LovValue.
See Also:
LovValue, getPK()

getPK

public java.lang.Object getPK()
This method should be use instead of the old getOid() method.

Specified by:
getPK in interface LovValue
Returns:
The pk of this particular LovValue.
See Also:
LovValue, LovBean

getFieldValue

public java.lang.Object getFieldValue(java.lang.String p_fieldName)
Description copied from interface: LovValue
This method enable the access to the values stored in this LovValue for the given field name.

Specified by:
getFieldValue in interface LovValue
Parameters:
p_fieldName - The name of the field for which the value is desired.
Returns:
the value associated with the given field name or null if no match is found.

addField

public void addField(java.lang.String p_fieldName,
                     java.lang.Object p_fieldValue)
It will replace any previous value with the same field name.

Parameters:
p_fieldName - The field name identifying the given value.
p_fieldValue - The value to be stored for the given field name.

equals

public boolean equals(java.lang.Object p_lovValue)
Parameters:
p_lovValue - The other LovValue to test against. The check is done on the Class of the other LovValue (needs to be a DefaultLovValue to be considered equal), the pk and on the fields (map comparison).
Returns:
true if two LovValue are equals, false otherwise.

toString

public java.lang.String toString()
Returns:
a String representation of this LovValue, displaying the LovValue PK then each field. ex: 12, SHORT_NAME=FR, LONG_NAME=FRANCE, REGION=EUROPE, HEMISPHERE=NORTH HEMISPHERE 13, SHORT_NAME=UK, LONG_NAME=UNITED KINGDOM, REGION=EUROPE, HEMISPHERE=NORTH HEMISPHERE