BrightSide Workbench Full Report + Source Code
SaleActionComparator.java
Go to the documentation of this file.
1 package org.turro.crm.zul.sale;
2 
3 import java.util.Comparator;
4 import org.turro.crm.entity.SaleAction;
5 import org.turro.util.CompareUtil;
6 
11 public class SaleActionComparator implements Comparator {
12 
13  @Override
14  public int compare(Object o1, Object o2) {
15  SaleAction sa1 = (SaleAction) o1, sa2 = (SaleAction) o2;
16  int result = CompareUtil.compare(sa1.getActionDate(), sa2.getActionDate());
17  if(result == 0) {
18  result = CompareUtil.compare(sa1.getFinalDate(), sa2.getFinalDate());
19  }
20  if(result == 0) {
21  result = CompareUtil.compare(sa1.getId(), sa2.getId());
22  }
23  return result;
24  }
25 
26 }