No setter/getter for Firebase objects

Viewed 1214

This is my Java class:

public class OnlineMatch{

private FacebookUser firstplayer;
private FacebookUser secondplayer;


public OnlineMatch(){

}


public OnlineMatch(FacebookUser firstplayer, FacebookUser secondplayer) {
    this.firstplayer = firstplayer;
    this.secondplayer = secondplayer;
}

public FacebookUser getFirstplayer() {
    return firstplayer;
}

public void setFirstplayer(FacebookUser firstplayer) {
    this.firstplayer = firstplayer;
}

public FacebookUser getSecondplayer() {
    return secondplayer;
}

public void setSecondplayer(FacebookUser secondplayer) {
    this.secondplayer = secondplayer;
}

}

I can create objects correctly and uploaded to Firebase. The db structure is as follow: Screenshot taken from firebase panel control

Then I try to print the values of my OnlineMatch objects (Kotlin code):

val match = dataSnapshot.child("multiplayer").getValue(OnlineMatch::class.java)
            if(match!=null){
                System.out.println(match)
            }

Here I get this output on the Android Studio console:

9548-19548/app.simone W/ClassMapper: No setter/field for -KqV44f4FUxV8ZDuqL4Y found on class app.simone.multiplayer.model.OnlineMatch

08-01 19:14:38.816 19548-19548/app.simone W/ClassMapper: No setter/field for -KqV3sAPXPcYrtr61cDy found on class app.simone.multiplayer.model.OnlineMatch

08-01 19:14:38.816 19548-19548/app.simone W/ClassMapper: No setter/field for -KqV2BGH7Z-Y9RxnPGpt found on class app.simone.multiplayer.model.OnlineMatch

2 Answers
Related