1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.mobility.push.service.rest.pojo;
16
17 import javax.xml.bind.annotation.*;
18 import java.util.HashMap;
19 import java.util.Map;
20
21
22
23
24 @XmlRootElement
25 @XmlAccessorType(XmlAccessType.FIELD)
26 @XmlSeeAlso(HashMap.class)
27 public class MapResponse<T, E> extends ServiceObject {
28
29 @XmlElementWrapper(name="map")
30 @XmlElement(name = "entry")
31 private HashMap<T, E> data;
32
33 public MapResponse(Map<T, E> data){
34 if(data instanceof HashMap){
35 this.data = (HashMap)data;
36 }
37 else{
38 this.data = new HashMap<T, E>(data);
39 }
40 }
41
42 public MapResponse(){
43 this.data = null;
44 }
45
46 public HashMap<T, E> getMap(){
47 return this.data;
48 }
49
50 public void setMap(HashMap<T, E> data){
51 this.data = data;
52 }
53 }