I am trying to convert DataSnapshot value to object. Its working fine, I believe that bean constructor(with arguments) used for conversion. I added some lines of code to perform some opeations, but lines of code I added never get executed. Sample bean class:
@IgnoreExtraProperties
public class DatabaseRecord {
private String firstName;
private String lastName;
private String fullName;
private DatabaseRecord() {
}
public DatabaseRecord(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
// following code not executing
this.fullName = firstName + lastName;
}
public String getFirstName() { return firstName; }
public String getLastName() { return lastName; }
public String getFullName() { return fullName; }
}
Firebase online database flow:

Data fetch execution code:
DatabaseReference databaseReference = database.getReference("/user/user1");
databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
DatabaseRecord record = dataSnapshot.getValue(DatabaseRecord.class);
Log.d(TAG, record.getFirstName()+":"+record.getLastName()+":"+record.getFullName());
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
Output:
Satish:Pandey:null
Google documentation shows parameterized constructor to set properties, if that is the case why not my code executing?
How to append my code after google conversion finishes in same bean object?