-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProducts.java
More file actions
33 lines (23 loc) · 805 Bytes
/
Products.java
File metadata and controls
33 lines (23 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package api.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "products")
public class Products implements Serializable {
private static final long serialVersionUID = 1L;
private List<Product> products = new ArrayList<>();
public Products() { }
@XmlElement(name = "product")
public List<Product> getProducts() {
return products; }
@XmlAttribute(name = "length")
public int getLength() {
return products.size(); }
public void setProducts(List<Product> products) {
this.products = products; }
public void add(Product product) {
this.products.add(product); }
}