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 import javax.xml.bind.annotation.XmlAccessorType;
10 import javax.xml.bind.annotation.XmlAttribute;
11 import javax.xml.bind.annotation.XmlElement;
12 import javax.xml.bind.annotation.XmlRootElement;
13 import javax.xml.bind.annotation.XmlTransient;
14 import java.util.List;
15
16 @XmlRootElement
17 @XmlAccessorType(FIELD)
18 public class Developers implements ListWrapper<Developer>
19 {
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 {
36 this.size = 0;
37 callback = null;
38 }
39
40 public Developers(int size, ListWrapperCallback<Developer> callback)
41 {
42 this.size = size;
43 this.callback = Preconditions.checkNotNull(callback);
44 }
45
46 public int getSize()
47 {
48 return size;
49 }
50
51 public void setDevelopers(List<Developer> developers)
52 {
53 this.developers = developers;
54 }
55
56 public List<Developer> getDevelopers()
57 {
58 return developers;
59 }
60
61 public ListWrapperCallback<Developer> getCallback()
62 {
63 return callback;
64 }
65 }