Can we return HashMap<String, Object> from jersey JSR-311 resource as response

108 Views Asked by At

I have a requirement of a response from jersey controller where name and type of the properties in response are returned from and external service and are not fixed, So I am thinking to return HashMap<String, Object>. Can we return HashMap<String, Object> from jersey JSR-311 resource as response. Or any other solution for it.

Sample Response looks like:

@XmlType
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
MyResponse{
@XmlElement
String id;

@XmlElement
HashMap<String, Object> properties;
}
0

There are 0 best solutions below