}
protected void sort(final String column, final boolean ascending) {
Comparator comparator = new Comparator() {
public int compare(Object o1, Object o2) {
OpportunityVO c1 = (OpportunityVO) o1;
OpportunityVO c2 = (OpportunityVO) o2;
if (column == null) {
return 0;
}
if (column.equals("custAccountId")) {
return ascending
? c1.getCustAccountVO().getCustAccountId().compareTo(
c2.getCustAccountVO().getCustAccountId())
: c2.getCustAccountVO().getCustAccountId().compareTo(
c1.getCustAccountVO().getCustAccountId());
} else if (column.equals("expiresOn")) {
return ascending
? c1.getExpiresOn().compareTo(c2.getExpiresOn())
: c2.getExpiresOn().compareTo(c1.getExpiresOn());
} else {
return 0;
}
}
};