|
|
@@ -25,15 +25,15 @@ public class Leg extends ValueObjectSupport<Leg> {
|
|
25
|
25
|
Validate.notNull(unloadLocation, "Unload location is required");
|
|
26
|
26
|
Validate.notNull(loadTime, "Load time is required");
|
|
27
|
27
|
Validate.notNull(unloadTime, "Unload time is required");
|
|
28
|
|
- Validate.isTrue(!loadLocation.sameAs(unloadLocation));
|
|
29
|
|
- // TODO use a minimum time between unloading and loading?
|
|
|
28
|
+ Validate.isTrue(!loadLocation.sameAs(unloadLocation), "Load location can't be the same as unload location");
|
|
|
29
|
+ // TODO enable this
|
|
30
|
30
|
//Validate.isTrue(unloadTime.after(loadTime));
|
|
31
|
31
|
|
|
32
|
32
|
this.voyage = voyage;
|
|
33
|
33
|
this.loadLocation = loadLocation;
|
|
34
|
34
|
this.unloadLocation = unloadLocation;
|
|
35
|
|
- this.loadTime = loadTime;
|
|
36
|
|
- this.unloadTime = unloadTime;
|
|
|
35
|
+ this.loadTime = new Date(loadTime.getTime());
|
|
|
36
|
+ this.unloadTime = new Date(unloadTime.getTime());
|
|
37
|
37
|
}
|
|
38
|
38
|
|
|
39
|
39
|
/**
|