Home > Mobile >  Type of attribute of class for retrieving list from firebase
Type of attribute of class for retrieving list from firebase

Time:12-31

Sample from database

I have a class Candidat. I want to know what should be the type of attribute « offres » so I can retrieve it from firebase the same way I do for the other attibutes when I build my object this way :

Candidat candidat = snapshot.child(mail).getValue(Candidat.class);

I have no issues getting the other attributes into my class Candidat with simple casting :

private String password;
private String nom;
private String prenom;
private String dateNaissance;
private String sexe;
private String nationalite;
private boolean affichageInfo;

But I don't know how to do it with "offres".

CodePudding user response:

It is a List<Map<String, int>>. You have an immutable variable type in that map.

CodePudding user response:

Your offress looks like an array of numbers, so that should map to:

public List<long> offres;
  • Related