@Status(stage=TEST, unitTests=ABSENT) public abstract class ValueObject extends Object implements ValueObjectInterface
Constructor and Description |
---|
ValueObject()
Default constructor that creates a value object with a null object Id and
null version.
|
ValueObject(Long objectId,
Integer version)
Creates this value object using the supplied objectId and version.
|
ValueObject(ValueObject source)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Determines whether this object is equal to the supplied Object.
|
Long |
getObjectId()
Gets the object Id of this value object.
|
Integer |
getVersion()
Gets the version of this ValueObject.
|
int |
hashCode()
Computes the hash code of this Object.
|
String |
toString()
Creates a String representation of this ValueObject.
|
void |
validate()
Validates the state of this ValueObject.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
copyFrom
public ValueObject()
public ValueObject(ValueObject source) throws InvalidStateException
source
- ValueObject whose value (data) is copied into this
ValueObject.InvalidStateException
- When at least one attribute in the source
ValueObject is not valid.NullPointerException
- When the supplied source object is null.public ValueObject(Long objectId, Integer version)
objectId
- The object Id for the ValueObject.version
- The version for the ValueObject.public Long getObjectId()
getObjectId
in interface ValueObjectInterface
public Integer getVersion()
getVersion
in interface ValueObjectInterface
public void validate() throws InvalidStateException
validate
in interface ValueObjectInterface
InvalidStateException
- In case the state of this value object
is not valid.
public boolean equals(Object object)
public int hashCode()
Copyright © 2008–2018. All rights reserved.