se.citerus.dddsample.domain.shared.experimental
Class ValueObjectSupport<T extends ValueObject>

java.lang.Object
  extended by se.citerus.dddsample.domain.shared.experimental.ValueObjectSupport<T>
Type Parameters:
T -
All Implemented Interfaces:
java.io.Serializable, ValueObject<T>

public abstract class ValueObjectSupport<T extends ValueObject>
extends java.lang.Object
implements ValueObject<T>

Base class for value objects.

See Also:
Serialized Form

Constructor Summary
ValueObjectSupport()
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 boolean sameValueAs(T other)
          Value objects compare by the values of their attributes, they don't have an identity.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueObjectSupport

public ValueObjectSupport()
Method Detail

sameValueAs

public final boolean sameValueAs(T other)
Description copied from interface: ValueObject
Value objects compare by the values of their attributes, they don't have an identity.

Specified by:
sameValueAs in interface ValueObject<T extends ValueObject>
Parameters:
other - The other value object.
Returns:
True if all non-transient fields are equal.

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
Hash code built from all non-transient fields.

equals

public final boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
Parameters:
o - other object
Returns:
True if other object has the same value as this value object.


Copyright © 2009. All Rights Reserved.