1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.chukwa.datacollection.agent.rest;
19
20 import java.util.ArrayList;
21 import java.util.List;
22
23 import javax.xml.bind.annotation.XmlAccessType;
24 import javax.xml.bind.annotation.XmlAccessorType;
25 import javax.xml.bind.annotation.XmlElement;
26 import javax.xml.bind.annotation.XmlRootElement;
27
28 @XmlRootElement
29 @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
30 public class AdaptorList {
31 private List<AdaptorInfo> adaptorInfo;
32
33 @XmlElement
34 public List<AdaptorInfo> getAdaptorInfo() {
35 return this.adaptorInfo;
36 }
37
38 public void setAdaptorInfo(List<AdaptorInfo> adaptorInfo) {
39 this.adaptorInfo = adaptorInfo;
40 }
41
42 public void add(AdaptorInfo adaptorInfo) {
43 if(this.adaptorInfo == null) {
44 this.adaptorInfo = new ArrayList<AdaptorInfo>();
45 }
46 this.adaptorInfo.add(adaptorInfo);
47 }
48
49 @XmlElement
50 public int getAdaptorCount() {
51 int count = 0;
52 if(this.adaptorInfo != null) {
53 count = this.adaptorInfo.size();
54 }
55 return count;
56 }
57 }