You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final UserEntity[] userEntityArray = this.gson.fromJson(userListJsonResponse, UserEntity[].class);
userEntityCollection = new ArrayList<>(Arrays.asList(userEntityArray));
The text was updated successfully, but these errors were encountered:
"So, whats the deal with the JsonSerializer class? Just asking."
It is just a wrapper around gson, in order to not depend on external libraries, thus if you wanna change the serializer you just modify that class.
I've already did that, my question was if this separation was intentional.
In this case, would be a good practice, the serialization be in one class, and the deserialization in another?
Or put all json handle methods in one class.
So, whats the deal with the JsonSerializer class? Just asking.
I think you can serialize the UserEntity with the UserEntityJsonMapper, just adding the serializer methods.
I've found another way do use the gson, without use the Type.
Source: http://stackoverflow.com/a/17300003/1703546
I've changed the class methods, and ran the tests and is working fine.
Entity:
Entity Collection:
The text was updated successfully, but these errors were encountered: