dimanche 13 mai 2018

Merge values of two objects

I have complex java class as shown below.

Class FinalValue {
List<Item> items;
List<Option> options;

Class Item/Option {
 String itemId/optionId;
 Type type;
 Rate rate;
 String currency;
}

Class Rate {
Integer id;
BigDecimal rateAmount;
Boolean isActive;
}
    }

I want to merge the values of list List<FinalValue> to single one FinalValue with some comparison. Is there any better approach to address this issue rather than looping to each level and add values.





Aucun commentaire:

Enregistrer un commentaire