skip to Main Content

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".

2

Answers


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

    Login or Signup to reply.
  2. Your offress looks like an array of numbers, so that should map to:

    public List<long> offres;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search