I am having 2 arraylists with one key field. Is there any smart way how to join values from one arraylist with values from another arraylist based on the key value?
Problem is that sometimes one arraylist is bigger and contains keys which the other doesn't and sometimes its reversed.
Should I just loop through them, compare the fields etc? Or is there anything better?
By key I mean ArrayList<Record>
Where Record contains:
String blabla;
String keyOrWhatever... just some unique name;
And then there is another ArrayList<Record2>
Where Record2 contains:
String differentbleble;
String theSameKeyASRecord;
Sometimes one List
or another might have different amount of values.
The result I imagine to have is Result3
Having fields:
String differentbleble;
String blabla;
String keyOrWhatever... just some unique name;