org.julp
Class ValueObject<T>

java.lang.Object
  extended by org.julp.ValueObject<T>
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ValueObject<T>>

public class ValueObject<T>
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<ValueObject<T>>

See Also:
Serialized Form

Field Summary
protected  boolean compareByValue
           
protected  boolean errorOnNullCompare
           
private static long serialVersionUID
           
protected  T value
           
protected  java.lang.String valueLabel
           
 
Constructor Summary
ValueObject()
           
ValueObject(T value, java.lang.String valueLabel)
           
ValueObject(T value, java.lang.String valueLabel, boolean compareByValue)
           
 
Method Summary
 int compareTo(ValueObject<T> otherObj)
           
 boolean equals(java.lang.Object otherObj)
           
 T getValue()
           
 java.lang.String getValueLabel()
           
 int hashCode()
           
 boolean isCompareByValue()
           
 boolean isErrorOnNullCompare()
           
 void setCompareByValue(boolean compareByValue)
           
 void setErrorOnNullCompare(boolean errorOnNullCompare)
           
 void setValue(T value)
           
 void setValueLabel(java.lang.String valueLabel)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

value

protected T value

valueLabel

protected java.lang.String valueLabel

compareByValue

protected boolean compareByValue

errorOnNullCompare

protected boolean errorOnNullCompare
Constructor Detail

ValueObject

public ValueObject()

ValueObject

public ValueObject(T value,
                   java.lang.String valueLabel)

ValueObject

public ValueObject(T value,
                   java.lang.String valueLabel,
                   boolean compareByValue)
Method Detail

getValue

public T getValue()

setValue

public void setValue(T value)

getValueLabel

public java.lang.String getValueLabel()

setValueLabel

public void setValueLabel(java.lang.String valueLabel)

isCompareByValue

public boolean isCompareByValue()

setCompareByValue

public void setCompareByValue(boolean compareByValue)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(ValueObject<T> otherObj)
Specified by:
compareTo in interface java.lang.Comparable<ValueObject<T>>

equals

public boolean equals(java.lang.Object otherObj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isErrorOnNullCompare

public boolean isErrorOnNullCompare()

setErrorOnNullCompare

public void setErrorOnNullCompare(boolean errorOnNullCompare)