1 25 26 package com.j2biz.blogunity.util; 27 28 import java.io.Serializable ; 29 import java.util.Comparator ; 30 31 import com.j2biz.blogunity.exception.BlogunityRuntimeException; 32 import com.j2biz.blogunity.i18n.I18N; 33 import com.j2biz.blogunity.i18n.I18NStatusFactory; 34 import com.j2biz.blogunity.pojo.Link; 35 36 43 public class LinkComparator implements Comparator ,Serializable { 44 45 48 private static final long serialVersionUID = 3256441417336173875L; 49 50 55 public int compare(Object o1, Object o2) { 56 57 try { 58 Link u1 = (Link) o1; 59 Link u2 = (Link) o2; 60 61 return u1.getOrder() - u2.getOrder(); 62 63 } catch (Exception e) { 64 throw new BlogunityRuntimeException(I18NStatusFactory.create( 65 I18N.ERRORS.UNABLE_TO_COMPARE, new String []{"links"}, e)); 66 } 67 68 } 69 70 } | Popular Tags |