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

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

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

An itinerary.

See Also:
Serialized Form

Constructor Summary
Itinerary(java.util.List<Leg> legs)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 boolean isExpected(HandlingEvent event)
          Test if the given handling event is expected when executing this itinerary.
 java.util.List<Leg> legs()
           
 boolean sameValueAs(Itinerary 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
 

Constructor Detail

Itinerary

public Itinerary(java.util.List<Leg> legs)
Constructor.

Parameters:
legs - List of legs for this itinerary.
Method Detail

legs

public java.util.List<Leg> legs()
Returns:
the legs of this itinerary, as an immutable list.

isExpected

public boolean isExpected(HandlingEvent event)
Test if the given handling event is expected when executing this itinerary.

Parameters:
event - Event to test.
Returns:
true if the event is expected

sameValueAs

public boolean sameValueAs(Itinerary 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<Itinerary>
Parameters:
other - itinerary to compare
Returns:
true if the legs in this and the other itinerary are all equal.

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.