1 package org.jahia.content.comparators; 2 3 import java.util.Comparator ; 4 import org.jahia.services.containers.ContentContainer; 5 6 15 16 public class ContainerByContainerListComparator implements Comparator { 17 18 public ContainerByContainerListComparator() { 19 } 20 21 public int compare(Object o1, Object o2) { 22 ContentContainer leftContainer = (ContentContainer) o1; 23 ContentContainer rightContainer = (ContentContainer) o2; 24 return new Integer (leftContainer.getParentContainerListID()).compareTo(new Integer (rightContainer.getParentContainerListID())); 25 } 26 27 public boolean equals(Object obj) { 28 if (obj instanceof ContainerByContainerListComparator) { 29 return true; 30 } else { 31 return false; 32 } 33 } 34 35 } | Popular Tags |