When deserializing/serializing an object, the jclouds GSON supports multiple 
annotations for defining variable names.
Example: you have some_value in JSON but in a jclouds domain class it should be 
someValue.
We have (at least):

@SerializedName (a GSON-specific annotation, applied to member variable)
@Named (guice injection annotation, applied to member variable)
@ConstructorProperties (java beans annotation, and applied to the constructor 
of the domain object)

I am not actually sure if @ConstructorProperties works for serialization (it 
works when deserializing).

I have seen all these 3 used. My personal preference is to only use 
@SerializedName, and only where needed. Can I get some more 
opinions/insight/feedback on these annotations?

Thanks!
Zack

Reply via email to