I have 3 lists so the order of their elements is important:
names: [a, b, c, d]
files: [a-file, b-file, c-file, d-file]
counts: [a-count, b-count, c-count, d-count]
I need to sort all of them alphabetically based on the List<String> names elements.
Can someone explain me how to do this?
Create a class to hold the tuple:
Then group the data from the three lists into a single list of this class:
And sort this list by
name, using a custom comparator:(Property accessors, null checking, etc omitted for brevity.)