I would like to have a data structure in the Firebase realtime database look like this:
{
"codigo": "01",
"Data": "1234567890",
"usuario": "{codigo : 01, nome : Rafael}"
}
I have the class:
class Consulta {
String codigo;
Long data;
Usuario usuario;
}
The user class has more attributes, but I just want to save the ones that are in JSON.
How do I save these values to stay in this structure? How do I read these values?
If you were an Arraylist, how would that read and write?