1 16 package org.apache.pluto.portlet.admin.util; 17 18 import java.util.Comparator ; 19 20 import org.apache.pluto.portalImpl.om.entity.impl.PortletApplicationEntityImpl; 21 import org.apache.pluto.portlet.admin.BaseAdminObject; 22 23 31 public class PortletApplicationEntityImplComparator extends BaseAdminObject implements Comparator { 32 33 private static final String CLASS_NAME = "PortletApplicationEntityImplComparator"; 34 public PortletApplicationEntityImplComparator() { 35 super(CLASS_NAME); 36 } 37 41 public int compare(Object obj1, Object obj2) { 42 if (!(obj1 instanceof PortletApplicationEntityImpl) || !(obj2 instanceof PortletApplicationEntityImpl)) { 43 throw new ClassCastException ("Wrong class type used for PortletApplicationEntityImplComparator"); 44 } else { 45 PortletApplicationEntityImpl app1 = (PortletApplicationEntityImpl)obj1; 46 PortletApplicationEntityImpl app2 = (PortletApplicationEntityImpl)obj2; 47 return app1.getCastorId().compareTo(app2.getCastorId()); 48 } 49 } 50 51 } 52 | Popular Tags |