• Post Reply Bookmark Topic Watch Topic
  • New Topic

how does one read a collection with jax-rs?

 
Elhanan Maayan
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
assume i get this this String from readEntity(String.class)

[{"objectVersion":0,"name":"System Campus","dimension":{"length":99999.0,"width":99999.0,"height":99999.0,"offsetX":0.0,"offsetY":0.0,"unit":"FEET"},"image":null,"buildingList":[],"aesUid":1417449177457}]

now i already have the campus class created, but the problem as you can see that it comes as an array, so i can't really use campus.class.
i don't see anything in the api that allows me to get a collection of objects.

 
Elhanan Maayan
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
final Collection<Campus> campuses = response.readEntity(new GenericType<Collection<Campus>>() {
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!