How to sort array of objects based on order of another array
I have an ArrayList of Strings in a certain particular order
ArrayList<String> sortedkeys
And I have an unordered set of objects
Set<Skugroup> unsortedSet
Where SkuGroup contains a key to be used for sorting
Class SkuGroup {
private String sortkey;
private String name;
}
I need to copy all the SkuGroup objects into a new array in the same order of sortedSkus, where the sortedkey value is the same as the SkuGroup->sortkey
How can I accomplish this?
from Recent Questions - Stack Overflow https://ift.tt/3zdhQWn
https://ift.tt/eA8V8J
Comments
Post a Comment