@Retention(value=RUNTIME) @Target(value=FIELD) public @interface SerializedName
JsonTransformer. Example model class:
public class MyData {
@SerializedName("my-field")
private String myField = "a";
}
Example code:
MyData data = ...; JsonTransformer transformer = ...; String json = transformer.toJson(data);After this code, the value of the "json" variable will be:
{"my-field":"a"}
public abstract String value
Created by Kornél Simon, 2022