android - Make first letter of child name capital in Firebase -




i push data firebase using order object, question want first letter of every child name capital. defined property "complain" in firebase still shows "complain", dont know how make it.

the current structure of firebase:

the current structure of firebase

the structure want:

the structure want

i defined property this:

@data public class order implements serializable {  @serializedname("complain") private string complain;  public order() {  complain = ""; }  public string getcomplain() {     return complain; }  public void setcomplain(string complain) {     complain = complain; } } 

i push data firebase this:

map<string, object> map = new hashmap<>(); map.put(ordersavepath, order); reference.updatechildren(map).addoncompletelistener(listener); 

the firebase json serialization name controlled annotation propertyname.

public class order implements serializable {      private string complain;      public order() {      complain = "";     }      @propertyname("complain")     public string getcomplain() {         return complain;     }      @propertyname("complain")     public void setcomplain(string complain) {         complain = complain;     }  } 

the annotation needs on both getter , setter. alternatively can use public fields , reduce class to:

public class order {     @propertyname("complain")     public string complain; } 




wiki

Comments

Popular posts from this blog

elasticsearch - what is the equivalent data type for geo_point in hibernate search? -

firebase - How to wait value in Ionic 2 -

Jenkins: find build number for git commit -