How to mention "Required" and "Optional" fields in the Response class of Retrofit2. In my case this is the response of API call
Json Class:
{
"id":"133544", //Required
"name":"abcd" //Optional
}
ModelClass :
public class User {
@SerializedName("id")
private String id;
@SerializedName("name")
private String name;
public String getId() {
return id;
}
public String getName() {
return name;
}
}
How to differentiate the required and optional fields here?