|
|
@@ -34,7 +34,7 @@ public class Itinerary implements ValueObject<Itinerary> {
|
|
34
|
34
|
this.legs = legs;
|
|
35
|
35
|
}
|
|
36
|
36
|
|
|
37
|
|
- public Itinerary(Leg... legs) {
|
|
|
37
|
+ public Itinerary(final Leg... legs) {
|
|
38
|
38
|
this(Arrays.asList(legs));
|
|
39
|
39
|
}
|
|
40
|
40
|
|
|
|
@@ -97,8 +97,8 @@ public class Itinerary implements ValueObject<Itinerary> {
|
|
97
|
97
|
/**
|
|
98
|
98
|
* @return The initial departure location.
|
|
99
|
99
|
*/
|
|
100
|
|
- Location initialDepartureLocation() {
|
|
101
|
|
- if (legs.isEmpty()) {
|
|
|
100
|
+ Location initialLoadLocation() {
|
|
|
101
|
+ if (isEmpty()) {
|
|
102
|
102
|
return Location.UNKNOWN;
|
|
103
|
103
|
} else {
|
|
104
|
104
|
return legs.get(0).loadLocation();
|
|
|
@@ -108,8 +108,8 @@ public class Itinerary implements ValueObject<Itinerary> {
|
|
108
|
108
|
/**
|
|
109
|
109
|
* @return The final arrival location.
|
|
110
|
110
|
*/
|
|
111
|
|
- Location finalArrivalLocation() {
|
|
112
|
|
- if (legs.isEmpty()) {
|
|
|
111
|
+ Location finalUnloadLocation() {
|
|
|
112
|
+ if (isEmpty()) {
|
|
113
|
113
|
return Location.UNKNOWN;
|
|
114
|
114
|
} else {
|
|
115
|
115
|
return lastLeg().unloadLocation();
|
|
|
@@ -119,7 +119,7 @@ public class Itinerary implements ValueObject<Itinerary> {
|
|
119
|
119
|
/**
|
|
120
|
120
|
* @return Date when cargo arrives at final destination.
|
|
121
|
121
|
*/
|
|
122
|
|
- Date finalArrivalDate() {
|
|
|
122
|
+ Date finalUnloadTime() {
|
|
123
|
123
|
if (isEmpty()) return new Date(END_OF_DAYS.getTime());
|
|
124
|
124
|
return new Date(lastLeg().unloadTime().getTime());
|
|
125
|
125
|
}
|