1 19 20 package com.sslexplorer.boot; 21 22 import java.util.Comparator ; 23 24 25 32 public class DefinitionComparator implements Comparator { 33 34 39 public int compare(Object arg0, Object arg1) { 40 PropertyDefinition def0 = (PropertyDefinition) arg0; 41 PropertyDefinition def1 = (PropertyDefinition) arg1; 42 int i = new Integer (def0.getCategory()).compareTo(new Integer (def1.getCategory())); 43 if (i == 0) { 44 i = new Integer (def0.getSortOrder()).compareTo(new Integer (def1.getSortOrder())); 45 if (i == 0) { 46 return def0.getName().compareTo(def1.getName()); 47 } else { 48 return i; 49 } 50 } else { 51 return i; 52 } 53 } 54 55 } | Popular Tags |