1 | public class Part {↵ | | 1 | public class Address {↵
|
2 | private Long id;↵ | | 2 | private Long id;↵
|
3 | private Item item;↵ | | 3 | private String streetAddress;↵
|
4 | private String name;↵ | | 4 | private String city;↵
|
5 | private String stockNumber;↵ | | 5 | private String country;↵
|
6 | private BigDecimal unitPrice;↵ | | 6 | private Person resident;↵
|
|
7 | public Part() {↵ | | 7 | public Address() {↵
|
8 | }↵ | | 8 | }↵
|
|
9 | public Part(Item item, String name, String stockNumber, BigDecimal unitPrice) {↵ | | 9 | public Address(String streetAddress, String city, String ↵
|
10 | this.item = item;↵ | | |
|
11 | this.name = name;↵ | | |
|
12 | this.stockNumber = stockNumber;↵ | | |
|
13 | this.unitPrice = unitPrice;↵ | | |
|
|
14 | this.item.getParts().add↵ | | 10 | country, Person resident) {↵
|
| | | 11 | this.streetAddress = streetAddress;↵
|
| | | 12 | this.city = city;↵
|
| | | 13 | this.country = country;↵
|
| | | 14 | this.resident = resident;↵
|
15 | ( this );↵ | | 15 | resident.setAddress( this );↵
|
16 | }↵ | | 16 | }↵
|
|
17 | public Long getId() {↵ | | 17 | public Long getId() {↵
|
18 | return id;↵ | | 18 | return id;↵
|
19 | }↵ | | 19 | }↵
|
|
20 | private void setId(Long id) {↵ | | 20 | public void setId(Long id) {↵
|
21 | this.id = id;↵ | | 21 | this.id = id;↵
|
22 | }↵ | | 22 | }↵
|
|
23 | public Item getItem() {↵ | | 23 | public String getStreetAddress() {↵
|
24 | return item;↵ | | 24 | return streetAddress;↵
|
25 | }↵ | | 25 | }↵
|
|
26 | private void setItem(Item item) {↵ | | 26 | public void set↵
|
27 | this.item = item↵ | | 27 | StreetAddress(String streetAddress) {↵
|
28 | ;↵ | | 28 | this.streetAddress = streetAddress;↵
|
29 | }↵ | | 29 | }↵
|
|
30 | public String getName() {↵ | | 30 | public String getCity() {↵
|
31 | return name;↵ | | 31 | return city;↵
|
32 | }↵ | | 32 | }↵
|
|
33 | public void setName(String name) {↵ | | 33 | public void setCity(String city) {↵
|
34 | this.name = name;↵ | | 34 | this.city = city;↵
|
35 | }↵ | | 35 | }↵
|
|
36 | public String getStockNumber() {↵ | | 36 | public String getCountry() {↵
|
37 | return stockNumber;↵ | | 37 | return country;↵
|
38 | }↵ | | 38 | }↵
|
|
39 | public void setStockNumber(String stockNumber) {↵ | | 39 | public void setCountry(String country) {↵
|
40 | this.stockNumber = stockNumber;↵ | | 40 | this.↵
|
41 | }↵ | | |
|
|
42 | public BigDecimal getUnitPrice↵ | | 41 | country = country;↵
|
| | | 42 | }↵
|
|
43 | () {↵ | | 43 | public Person getResident() {↵
|
44 | return unitPrice;↵ | | 44 | return resident;↵
|
45 | }↵ | | 45 | }↵
|
|
46 | public void setUnitPrice(BigDecimal unitPrice) {↵ | | 46 | public void set↵
|
47 | this.unitPrice = unitPrice | | 47 | Resident(Person resident) {↵
|
| | | 48 | this.resident = resident
|