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

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

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

An itinerary consists of one or more legs.

See Also:
Serialized Form

Constructor Summary
Leg(Voyage voyage, Location loadLocation, Location unloadLocation, java.util.Date loadTime, java.util.Date unloadTime)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 Location loadLocation()
           
 java.util.Date loadTime()
           
 boolean sameValueAs(Leg other)
          Value objects compare by the values of their attributes, they don't have an identity.
 Location unloadLocation()
           
 java.util.Date unloadTime()
           
 Voyage voyage()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Leg

public Leg(Voyage voyage,
           Location loadLocation,
           Location unloadLocation,
           java.util.Date loadTime,
           java.util.Date unloadTime)
Method Detail

voyage

public Voyage voyage()

loadLocation

public Location loadLocation()

unloadLocation

public Location unloadLocation()

loadTime

public java.util.Date loadTime()

unloadTime

public java.util.Date unloadTime()

sameValueAs

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