DatabaseException: Found two getters or fields with conflicting case sensitivity

前端 未结 3 434
耶瑟儿~
耶瑟儿~ 2020-12-06 07:26

Every time I try to retrieve data from my database, I get

com.google.firebase.database.DatabaseException: Found two getters or fields with conflicting case s         


        
3条回答
  •  我在风中等你
    2020-12-06 07:34

    I found a different solution to keep my field public String id and at the same time have the method public String getId() which I needed to implement because of an interface: Simply mark the method with @Exclude, e.g.:

    public class Group implements Identifiable
    {
        public String id;
    
        protected Group ()
        {
        }
    
        public Group ( String id )
        {
            this.id = id;
        }
    
        @Exclude
        @Override
        public String getId ()
        {
            return id;
        }
    }
    

提交回复
热议问题