THE STORY
I am using Firebase Realtime Database in my app. I have a model something like this.
class Item {
int mItemName;
/
Alternatively just mark your getters with @PropertyName instead of annotating properties themselves - this way you can keep properties private while providing custom names:
public class User extends Object {
private String mDisplayName;
@PropertyName("userName")
public String getDisplayName() {
return mDisplayName;
}
@PropertyName("userName")
public void setDisplayName(String displayName) {
mDisplayName = displayName;
}
}