1 package se.citerus.dddsample.interfaces.booking.web;
2
3 import org.apache.commons.collections.Factory;
4 import org.apache.commons.collections.ListUtils;
5
6 import java.util.ArrayList;
7 import java.util.Date;
8 import java.util.List;
9
10 public class RouteAssignmentCommand {
11
12 private String trackingId;
13 private List<LegCommand> legs = ListUtils.lazyList(
14 new ArrayList(), LegCommand.factory()
15 );
16
17 public String getTrackingId() {
18 return trackingId;
19 }
20
21 public void setTrackingId(String trackingId) {
22 this.trackingId = trackingId;
23 }
24
25 public List<LegCommand> getLegs() {
26 return legs;
27 }
28
29 public void setLegs(List<LegCommand> legs) {
30 this.legs = legs;
31 }
32
33 public static final class LegCommand {
34 private String voyageNumber;
35 private String fromUnLocode;
36 private String toUnLocode;
37 private Date fromDate;
38 private Date toDate;
39
40 public String getVoyageNumber() {
41 return voyageNumber;
42 }
43
44 public void setVoyageNumber(final String voyageNumber) {
45 this.voyageNumber = voyageNumber;
46 }
47
48 public String getFromUnLocode() {
49 return fromUnLocode;
50 }
51
52 public void setFromUnLocode(final String fromUnLocode) {
53 this.fromUnLocode = fromUnLocode;
54 }
55
56 public String getToUnLocode() {
57 return toUnLocode;
58 }
59
60 public void setToUnLocode(final String toUnLocode) {
61 this.toUnLocode = toUnLocode;
62 }
63
64 public Date getFromDate() {
65 return fromDate;
66 }
67
68 public void setFromDate(Date fromDate) {
69 this.fromDate = fromDate;
70 }
71
72 public Date getToDate() {
73 return toDate;
74 }
75
76 public void setToDate(Date toDate) {
77 this.toDate = toDate;
78 }
79
80 public static Factory factory() {
81 return new Factory() {
82 public Object create() {
83 return new LegCommand();
84 }
85 };
86 }
87
88 }
89 }