I have a Java collection:
Collection<CustomObject> list = new ArrayList<CustomObject>();
CustomObject
has an id
field now before display list I want to sort this collection by that id
.
Is there any way I could that do that?
I have a Java collection:
Collection<CustomObject> list = new ArrayList<CustomObject>();
CustomObject
has an id
field now before display list I want to sort this collection by that id
.
Is there any way I could that do that?
With Java 8 you have several options, combining method references and the built-in
comparing
comparator: