showType = isShowTypeSuffix() && contacts.size() > 1 && typeEnums.size() > 1;
showDefault = isShowDefaultSuffix() && contacts.size() > 1;
Collections.sort(contacts, new Comparator<MetaObject>() {
@Override
public int compare(MetaObject o1, MetaObject o2) {
PartyContact contact1 = (PartyContact) o1.getObject();
PartyContact contact2 = (PartyContact) o2.getObject();
if (contact1.getType().ordinal() > contact2.getType().ordinal()) {
return -1;
} else if (contact1.getType().ordinal() < contact2.getType().ordinal()) {
return 1;
} else if (contact1.getDefaultContact().booleanValue()) {
return -1;
} else if (contact2.getDefaultContact().booleanValue()) {
return 1;
} else {
return contact1.getPresentationValue().compareTo(contact2.getPresentationValue());
}
}
});
return contacts;
}