se.citerus.dddsample.domain.model.voyage
Class CarrierMovement

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

public final class CarrierMovement
extends java.lang.Object
implements ValueObject<CarrierMovement>

A carrier movement is a vessel voyage from one location to another.

See Also:
Serialized Form

Field Summary
static CarrierMovement NONE
           
 
Constructor Summary
CarrierMovement(Location departureLocation, Location arrivalLocation, java.util.Date departureTime, java.util.Date arrivalTime)
          Constructor.
 
Method Summary
 Location arrivalLocation()
           
 java.util.Date arrivalTime()
           
 Location departureLocation()
           
 java.util.Date departureTime()
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 boolean sameValueAs(CarrierMovement 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

NONE

public static final CarrierMovement NONE
Constructor Detail

CarrierMovement

public CarrierMovement(Location departureLocation,
                       Location arrivalLocation,
                       java.util.Date departureTime,
                       java.util.Date arrivalTime)
Constructor.

Parameters:
departureLocation - location of departure
arrivalLocation - location of arrival
departureTime - time of departure
arrivalTime - time of arrival
Method Detail

departureLocation

public Location departureLocation()
Returns:
Departure location.

arrivalLocation

public Location arrivalLocation()
Returns:
Arrival location.

departureTime

public java.util.Date departureTime()
Returns:
Time of departure.

arrivalTime

public java.util.Date arrivalTime()
Returns:
Time of arrival.

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

sameValueAs

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


Copyright © 2009. All Rights Reserved.