1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.bremersee.xml.test.model.xml2;
18
19 import java.util.ArrayList;
20 import java.util.List;
21 import java.util.Objects;
22 import jakarta.xml.bind.annotation.XmlAccessType;
23 import jakarta.xml.bind.annotation.XmlAccessorType;
24 import jakarta.xml.bind.annotation.XmlAttribute;
25 import jakarta.xml.bind.annotation.XmlElement;
26 import jakarta.xml.bind.annotation.XmlElementWrapper;
27 import jakarta.xml.bind.annotation.XmlRootElement;
28 import jakarta.xml.bind.annotation.XmlType;
29
30
31
32
33
34
35 @XmlRootElement(name = "vehicles")
36 @XmlType(name = "vehiclesType")
37 @XmlAccessorType(XmlAccessType.FIELD)
38 public class Vehicles {
39
40 @XmlAttribute(required = true)
41 private String series;
42
43 @XmlAttribute(required = true)
44 private int year;
45
46 @XmlElement(defaultValue = "0")
47 private Integer month;
48
49 @XmlElementWrapper(name = "list")
50 @XmlElement(name = "vehicle")
51 private List<Vehicle> entries = new ArrayList<>();
52
53
54
55
56
57
58 @SuppressWarnings("unused")
59 public String getSeries() {
60 return series;
61 }
62
63
64
65
66
67
68 public void setSeries(String series) {
69 this.series = series;
70 }
71
72
73
74
75
76
77 @SuppressWarnings("unused")
78 public int getYear() {
79 return year;
80 }
81
82
83
84
85
86
87 public void setYear(int year) {
88 this.year = year;
89 }
90
91
92
93
94
95
96 @SuppressWarnings("unused")
97 public Integer getMonth() {
98 return month;
99 }
100
101
102
103
104
105
106 public void setMonth(Integer month) {
107 this.month = month;
108 }
109
110
111
112
113
114
115 public List<Vehicle> getEntries() {
116 return entries;
117 }
118
119 @Override
120 public boolean equals(Object o) {
121 if (this == o) {
122 return true;
123 }
124 if (o == null || getClass() != o.getClass()) {
125 return false;
126 }
127 Vehicles vehicles = (Vehicles) o;
128 return year == vehicles.year
129 && Objects.equals(series, vehicles.series)
130 && Objects.equals(month, vehicles.month)
131 && Objects.equals(entries, vehicles.entries);
132 }
133
134 @Override
135 public int hashCode() {
136 return Objects.hash(series, year, month, entries);
137 }
138
139 @Override
140 public String toString() {
141 return "Vehicles{"
142 + "series='" + series + '\''
143 + ", year=" + year
144 + ", month=" + month
145 + '}';
146 }
147 }