Hi All
I have a really annoying problem , please take a look at the code:
ObjectMapper mapper = new ObjectMapper();
List<Message> messageList = new ArrayList<Message>();
messageList.add(new RoomTextMessage(1,"2","22",1));
messageList.add(new PresenceMessage(1,1,2, UserStatus.OFFLINE));
mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_CONCRETE_AND_ARRAYS);
String s = mapper.writeValueAsString(messageList);
mapper.convertValue(s,???)
RoomTextMessage , and PresenceMessage extend Message.
So when I print out s after writeValueAsString , this is what I get :
[["com.delver.chateau.message.RoomTextMessage",{"text":"22","roomId":"2","userId":1,"sequence":1}],["com.delver.chateau.message.PresenceMessage",{"friendId":2,"status":"OFFLINE","userId":1,"sequence":1}]]
I have no idea how to covert it back to the arrayList , I have almost every API the ObjectMapper has.
A little help would be very appreciated.