I'm using Cloud Firestore with Android Studio. I've noticed that it seems to save every field in a class to the database, not just to ones that have setters/getters. How do I stop this from happening?
For example, let's say I have a class called Box
, defined like this:
private class Box {
private int id;
private String name, label;
public Box(){}
public void setId(int thisId) {id = thisId;}
public void setName(String thisName) { name = thisName;}
public int getId() { return id;}
public String getName { return name;}
public setup label () { ... }
}
I only have setters and getters for id and name, because they're the ones I want to save to the database. I don't want to save label, because it changes each time. However, it's saving it anyway, with a value of null.
What am I doing wrong? How do I stop it from saving a value for label?