se.citerus.dddsample.domain.model.handling
Class HandlingHistory

java.lang.Object
  extended by se.citerus.dddsample.domain.model.handling.HandlingHistory
All Implemented Interfaces:
java.io.Serializable, ValueObject<HandlingHistory>

public class HandlingHistory
extends java.lang.Object
implements ValueObject<HandlingHistory>

The handling history of a cargo.

See Also:
Serialized Form

Field Summary
static HandlingHistory EMPTY
           
 
Constructor Summary
HandlingHistory(java.util.Collection<HandlingEvent> handlingEvents)
           
 
Method Summary
 java.util.List<HandlingEvent> distinctEventsByCompletionTime()
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 HandlingEvent mostRecentlyCompletedEvent()
           
 boolean sameValueAs(HandlingHistory 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
 

Field Detail

EMPTY

public static final HandlingHistory EMPTY
Constructor Detail

HandlingHistory

public HandlingHistory(java.util.Collection<HandlingEvent> handlingEvents)
Method Detail

distinctEventsByCompletionTime

public java.util.List<HandlingEvent> distinctEventsByCompletionTime()
Returns:
A distinct list (no duplicate registrations) of handling events, ordered by completion time.

mostRecentlyCompletedEvent

public HandlingEvent mostRecentlyCompletedEvent()
Returns:
Most recently completed event, or null if the delivery history is empty.

sameValueAs

public boolean sameValueAs(HandlingHistory 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<HandlingHistory>
Parameters:
other - The other value object.
Returns:
true if the given value object's and this value object's attributes are the same.

equals

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

hashCode

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


Copyright © 2009. All Rights Reserved.