* @param acending - true when ascending
*/
protected void sort(final String column, final boolean ascending) {
Comparator comparator = new Comparator() {
public int compare(Object o1, Object o2) {
QuoteVO c1 = (QuoteVO) o1;
QuoteVO c2 = (QuoteVO) o2;
if (column == null) {
return 0;
}
if (column.equals("quoteState")) {
return ascending
? c1.getQuoteState().compareTo(c2.getQuoteState())
: c2.getQuoteState().compareTo(c1.getQuoteState());
} else if (column.equals("quoteNumber")) {
return ascending
? c1.getQuoteNumber().compareTo(c2.getQuoteNumber())
: c2.getQuoteNumber().compareTo(c1.getQuoteNumber());
} else {
return 0;
}
}
};