se.citerus.dddsample.domain.model.handling
Class HandlingHistory
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
EMPTY
public static final HandlingHistory EMPTY
HandlingHistory
public HandlingHistory(java.util.Collection<HandlingEvent> handlingEvents)
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.