Java - Distinct List of Objects

后端 未结 9 933
不知归路
不知归路 2020-12-05 09:41

I have a list/collection of objects that may or may not have the same property values. What\'s the easiest way to get a distinct list of the objects with equal properties? I

9条回答
  •  广开言路
    2020-12-05 10:30

    order preserving version of the above response

    return new ArrayList(new LinkedHashSet(recipients));
    

提交回复
热议问题