1 | public class PurchaseDetail {↵ | | 1 | public class Task {↵
|
2 | ↵ | | 2 | ↵
|
3 | private PurchaseRecord purchaseRecord;↵ | | 3 | private ↵
|
4 | ↵ | | 4 | String description;↵
|
5 | private String productId;↵ | | 5 | private Person person;↵
|
6 | private int quantity;↵ | | 6 | private int version;↵
|
7 | ↵ | | 7 | ↵
|
8 | public PurchaseDetail(PurchaseRecord record, String productId, int quantity) {↵ | | 8 | public ↵
|
9 | this.productId = productId;↵ | | |
|
10 | this.quantity = quantity;↵ | | |
|
11 | this.purchaseRecord = record;↵ | | |
|
12 | }↵ | | |
|
13 | public PurchaseDetail() {}↵ | | |
|
14 | ↵ | | |
|
15 | ↵ | | |
|
16 | /**↵ | | |
|
17 | * @return the purchaseRecord↵ | | |
|
18 | */↵ | | |
|
19 | public PurchaseRecord getPurchaseRecord() {↵ | | |
|
20 | return purchaseRecord;↵ | | |
|
21 | }↵ | | |
|
22 | /**↵ | | |
|
23 | * @param purchaseRecord the purchaseRecord to set↵ | | |
|
24 | */↵ | | |
|
25 | public void setPurchaseRecord(PurchaseRecord purchaseRecord) {↵ | | |
|
26 | this.purchaseRecord = purchaseRecord;↵ | | |
|
27 | }↵ | | |
|
28 | /**↵ | | |
|
29 | * @return the quantity↵ | | |
|
30 | */↵ | | 9 | int getVersion() {↵
|
| | | 10 | return version;↵
|
| | | 11 | }↵
|
| | | 12 | public void setVersion(int version) {↵
|
| | | 13 | this.version = version;↵
|
| | | 14 | }↵
|
| | | 15 | Task() {}↵
|
| | | 16 | public Task(String description, Person person) {↵
|
| | | 17 | this.description = description;↵
|
| | | 18 | this.person = person;↵
|
| | | 19 | person.getTasks().add(this);↵
|
| | | 20 | }↵
|
31 | public int getQuantity() {↵ | | 21 | public String getDescription() {↵
|
32 | return quantity;↵ | | 22 | return ↵
|
33 | }↵ | | |
|
34 | /**↵ | | |
|
35 | * @param quantity the quantity to set↵ | | |
|
36 | */↵ | | |
|
37 | public void setQuantity(int quantity) {↵ | | |
|
38 | this.quantity = quantity;↵ | | |
|
39 | }↵ | | |
|
40 | /**↵ | | |
|
41 | * @return the productId↵ | | |
|
42 | */↵ | | 23 | description;↵
|
| | | 24 | }↵
|
| | | 25 | public void setDescription(String description) {↵
|
| | | 26 | this.description = description;↵
|
| | | 27 | }↵
|
43 | public String getProductId() {↵ | | 28 | public ↵
|
44 | return productId;↵ | | |
|
45 | }↵ | | |
|
46 | /**↵ | | |
|
47 | * @param productId the productId to set↵ | | |
|
48 | */↵ | | 29 | Person getPerson() {↵
|
| | | 30 | return person;↵
|
| | | 31 | }↵
|
49 | public void setProductId(String productId) {↵ | | 32 | public void setPerson(Person person) {↵
|
50 | this.productId = productId | | 33 | this.person = person
|