se.citerus.dddsample.domain.model.cargo
Class Delivery

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

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

The actual transportation of the cargo, as opposed to the customer requirement (RouteSpecification) and the plan (Itinerary).

See Also:
Serialized Form

Method Summary
 java.util.Date calculatedAt()
           
 Voyage currentVoyage()
           
 boolean equals(java.lang.Object o)
           
 java.util.Date estimatedTimeOfArrival()
           
 int hashCode()
           
 boolean isMisdirected()
          Check if cargo is misdirected.
 boolean isUnloadedAtDestination()
           
 Location lastKnownLocation()
           
 HandlingActivity nextExpectedActivity()
           
 RoutingStatus routingStatus()
           
 boolean sameValueAs(Delivery other)
          Value objects compare by the values of their attributes, they don't have an identity.
 TransportStatus transportStatus()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

transportStatus

public TransportStatus transportStatus()
Returns:
Transport status

lastKnownLocation

public Location lastKnownLocation()
Returns:
Last known location of the cargo, or Location.UNKNOWN if the delivery history is empty.

currentVoyage

public Voyage currentVoyage()
Returns:
Current voyage.

isMisdirected

public boolean isMisdirected()
Check if cargo is misdirected.

Returns:
true if the cargo has been misdirected,

estimatedTimeOfArrival

public java.util.Date estimatedTimeOfArrival()
Returns:
Estimated time of arrival

nextExpectedActivity

public HandlingActivity nextExpectedActivity()
Returns:
The next expected handling activity.

isUnloadedAtDestination

public boolean isUnloadedAtDestination()
Returns:
True if the cargo has been unloaded at the final destination.

routingStatus

public RoutingStatus routingStatus()
Returns:
Routing status.

calculatedAt

public java.util.Date calculatedAt()
Returns:
When this delivery was calculated.

sameValueAs

public boolean sameValueAs(Delivery 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<Delivery>
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.