static class StringMeeting {
public String start;
public String end;
public StringMeeting(String start, String end) {
this.start = start;
this.end = end;
}
}
Set<StringMeeting> freeMeetingDurationSlots1 = getMeetingDurationSlots(freeSlotsCalendar1, meetingDuration);
Set<StringMeeting> freeMeetingDurationSlots2 = getMeetingDurationSlots(freeSlotsCalendar2, meetingDuration);
List<StringMeeting> commonSlots = new ArrayList<StringMeeting>();
for(StringMeeting freeMeetingDurationSlot1: freeMeetingDurationSlots1)
{
if(freeMeetingDurationSlots2.contains(freeMeetingDurationSlot1))
commonSlots.add(freeMeetingDurationSlot1);
}
I am trying to get the common slots and i see that freeMeetingDurationSlots2.contains(freeMeetingDurationSlot1) doesn't work. How can i say to hashset to compare based on the values of start and end time?