The Firebase documentation on lists provides an example where you create a Java object and write that object to a Firebase link through setValue() like this:
private static class MyObject { private String property1; private int property2; public MyObject(String value1, int value2) { this.property1 = value1; this.property2 = value2; } public String getFirstProperty() { return property1; } } private void populateList() { Firebase ref = new Firebase("https://MyDemo.firebaseIO-demo.com/myObjects"); ref.push().setValue(new MyObject("myString", "7")); }
How does it work within the organization, i.e. when you did not write the toString() method, etc., what value will be stored in the Firebase link exactly? And one more step, will the Firebase client be able to restore the old object from the stored value? How?
Do I need to have a private static class so that Firebase can read fields?
source share