1 package com.atlassian.plugins.rest.test;
2
3 import com.atlassian.plugins.rest.common.expand.Expandable;
4 import com.atlassian.plugins.rest.common.expand.entity.ListWrapper;
5 import com.atlassian.plugins.rest.common.expand.entity.ListWrapperCallback;
6 import com.google.common.base.Preconditions;
7
8 import static javax.xml.bind.annotation.XmlAccessType.*;
9
10 import javax.xml.bind.annotation.XmlAccessorType;
11 import javax.xml.bind.annotation.XmlAttribute;
12 import javax.xml.bind.annotation.XmlElement;
13 import javax.xml.bind.annotation.XmlRootElement;
14 import javax.xml.bind.annotation.XmlTransient;
15 import java.util.List;
16
17 @XmlRootElement
18 @XmlAccessorType(FIELD)
19 public class Developers implements ListWrapper<Developer> {
20 @XmlAttribute
21 private String expand;
22
23 @XmlAttribute
24 private int size;
25
26 @XmlElement(name = "developer")
27 @Expandable
28 private List<Developer> developers;
29
30 @XmlTransient
31 private final ListWrapperCallback<Developer> callback;
32
33 @SuppressWarnings("unused")
34 private Developers() {
35 this.size = 0;
36 callback = null;
37 }
38
39 public Developers(int size, ListWrapperCallback<Developer> callback) {
40 this.size = size;
41 this.callback = Preconditions.checkNotNull(callback);
42 }
43
44 public int getSize() {
45 return size;
46 }
47
48 public void setDevelopers(List<Developer> developers) {
49 this.developers = developers;
50 }
51
52 public List<Developer> getDevelopers() {
53 return developers;
54 }
55
56 public ListWrapperCallback<Developer> getCallback() {
57 return callback;
58 }
59 }