Package org.jclouds.json
Annotation Interface SerializedNames
This annotation identifies the canonical factory method on an
AutoValue
type used for json.
It also dictates the serialized naming convention of the fields. This is required as there's currently
no way to add annotations to the fields generated by AutoValue
.
Example:
@AutoValue class Resource {
abstract String id();
@Nullable abstract Map<String, String> metadata();
@SerializedNames({ "Id", "Metadata" }) // Note case format is controlled here!
static Resource create(String id, Map<String, String> metadata) {
return new AutoValue_Resource(id, metadata);
}
}
-
Required Element Summary
Required Elements
-
Element Details
-
value
String[] valueOrdered values that dictate the naming convention for serialization.Note
The order of these names must exactly match the factory method parameters and also match the order of the auto-value constructor parameters.
-