se.citerus.dddsample.domain.model.cargo
Class RouteSpecification
java.lang.Object
se.citerus.dddsample.domain.shared.AbstractSpecification<Itinerary>
se.citerus.dddsample.domain.model.cargo.RouteSpecification
- All Implemented Interfaces:
- java.io.Serializable, Specification<Itinerary>, ValueObject<RouteSpecification>
public class RouteSpecification
- extends AbstractSpecification<Itinerary>
- implements ValueObject<RouteSpecification>
Route specification. Describes where a cargo orign and destination is,
and the arrival deadline.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
RouteSpecification
public RouteSpecification(Location origin,
Location destination,
java.util.Date arrivalDeadline)
- Parameters:
origin
- origin location - can't be the same as the destinationdestination
- destination location - can't be the same as the originarrivalDeadline
- arrival deadline
origin
public Location origin()
- Returns:
- Specified origin location.
destination
public Location destination()
- Returns:
- Specfied destination location.
arrivalDeadline
public java.util.Date arrivalDeadline()
- Returns:
- Arrival deadline.
isSatisfiedBy
public boolean isSatisfiedBy(Itinerary itinerary)
- Description copied from class:
AbstractSpecification
- Check if
t
is satisfied by the specification.
- Specified by:
isSatisfiedBy
in interface Specification<Itinerary>
- Specified by:
isSatisfiedBy
in class AbstractSpecification<Itinerary>
- Parameters:
itinerary
- Object to test.
- Returns:
true
if t
satisfies the specification.
sameValueAs
public boolean sameValueAs(RouteSpecification 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<RouteSpecification>
- 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.