ReaderRestPojo.java
980 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package fi.codecrew.moya.rest.pojo;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import fi.codecrew.moya.model.Reader;
import fi.codecrew.moya.model.ReaderType;
public class ReaderRestPojo {
private Reader reader;
@XmlElement(name = "readerId")
public Integer getId() {
return reader.getId();
}
@XmlElement(name = "identification")
public String getIdent() {
return reader.getIdentification();
}
@XmlElement(name = "description")
public String getDescr() {
return reader.getDescription();
}
@XmlElement(name = "readerType")
public ReaderType getType() {
return reader.getType();
}
public ReaderRestPojo() {
this.reader = null;
}
public ReaderRestPojo(Reader r) {
this.reader = r;
}
public static List<ReaderRestPojo> parse(List<Reader> readers) {
ArrayList<ReaderRestPojo> ret = new ArrayList<>();
for (Reader r : readers) {
ret.add(new ReaderRestPojo(r));
}
return ret;
}
}