jeudi 18 juillet 2019

How to update all the annotated fields in complex/nested pojo?

I have a complex pojo like this

Class Pojo {
    Integer intField;
    @Update
    String stringField;
    @Update
    Map<String, NestedPojo> nestedPojoMap;
    @Update
    List<NestedPojo> nestedPojoMap;

    static Class NestedPojo {
        @Update
        String stringNestedField;
    }
}

I want update fields that are annotated with @Update. How can I accomplish this.

I tried checking out code of gson (it uses exclusion strategy) but wasn't able to understand it. Is there any way to write a generic code?





Aucun commentaire:

Enregistrer un commentaire