mardi 4 août 2015

How to count number of custom objects in list which have same value for one of its attribute

I am programming in java. Say I have an custom object Item

class Item
{
     Integer id;
     BigDecimal itemNumber;
}

I have list of Items.

List<Item> items = new ArrayList<>();

Now, What is best way in java to know, list of Items contain some Items with same value for itemNumber.

Aucun commentaire:

Enregistrer un commentaire