使用getter setter从firebase获得所有价值

时间:2019-07-19 05:29:29

标签: java android firebase firebase-realtime-database

Firebase Database Node Structure我很难如上所述获得数据库中的所有值。如果使用getter设置器,则问题已解决,但我无法在名称为day和timestamp的子节点的登录/上获取数据。

[Firebase数据库映像] [2]



        public String email;
        public String gaji;
        public String id;
        public String jasapelayanan;
        public String nama;
        public String pass;
        public String status;
        public String idcase;
        public String alamat;
        public String terpakai;
        public String jabatan;
        public String nip;
        public String tl;
        Object signin;
        Object signout ;


        public getFIngerprintAllDataChildren(){

        }



    public getFIngerprintAllDataChildren(String alamat,
    String idcase,
    String email,
    String gaji, 
    String id, 
    String jasapelayanan, 
    String nama, 
    String pass, 
    String status, 
    String terpakai,
    String jabatan, 
    String nip, 
    String tl,
    Object signin,
    Object signout ) {
        this.email = email;
        this.gaji = gaji;
        this.id = id;
        this.jasapelayanan = jasapelayanan;
        this.nama = nama;
        this.pass = pass;
        this.status = status;
        this.terpakai = terpakai;
        this.jabatan = jabatan;
        this.nip = nip;
        this.tl = tl;
        this.idcase = idcase;
        this.alamat = alamat;
        this.signin = signin;
        this.signout = signout;

    }

    public Object getSignin() {
        return signin;
    }

    public Object getSignout() {
        return signout;
    }

    public String getAlamat() {
        return alamat;
    }




    public String getIdcase() {
        return idcase;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getGaji() {
        return gaji;
    }

    public void setGaji(String gaji) {
        this.gaji = gaji;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getJasapelayanan() {
        return jasapelayanan;
    }

    public void setJasapelayanan(String jasapelayanan) {
        this.jasapelayanan = jasapelayanan;
    }

    public String getNama() {
        return nama;
    }

    public void setNama(String nama) {
        this.nama = nama;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getTerpakai() {
        return terpakai;
    }

    public void setTerpakai(String terpakai) {
        this.terpakai = terpakai;
    }

    public String getJabatan() {
        return jabatan;
    }

    public void setJabatan(String jabatan) {
        this.jabatan = jabatan;
    }

    public String getNip() {
        return nip;
    }

    public void setNip(String nip) {
        this.nip = nip;
    }

    public String getTl() {
        return tl;
    }

    public void setTl(String tl) {
        this.tl = tl;
    }

这是我的DatabaseReferenceListener,它在上面使用了构造方法

          myRef.addListenerForSingleValueEvent(new ValueEventListener() {
            @Override
            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

                int i =0;
                List<getFIrebaseTimeStamp> sign = new ArrayList<>();
                for( DataSnapshot ds : dataSnapshot.getChildren()){


                    getFIngerprintAllDataChildren getFIngerprintAllDataChildren 
                    = ds.getValue(getFIngerprintAllDataChildren.class);
                    list.add(getFIngerprintAllDataChildren);
                }
     }

            @Override
            public void onCancelled(@NonNull DatabaseError databaseError) {


            }

        });

0 个答案:

没有答案