You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.1 KiB
28 lines
1.1 KiB
package com.fr.plugin.teshe.beans; |
|
|
|
import com.fr.plugin.teshe.entity.UserInOrganEntity; |
|
|
|
import java.util.Comparator; |
|
|
|
public class SecondOrganFullPathComparator implements Comparator { |
|
@Override |
|
public int compare(Object o1, Object o2) { |
|
if (o1 instanceof SecondOrganModel && o2 instanceof SecondOrganModel) { |
|
SecondOrganModel s1 = (SecondOrganModel) o1; |
|
SecondOrganModel s2 = (SecondOrganModel) o2; |
|
if (s1.getFullPathOrder().compareTo(s2.getFullPathOrder()) > 0) return 1; |
|
else if (s1.getFullPathOrder().compareTo(s2.getFullPathOrder()) < 0) return -1; |
|
else return 0; |
|
} |
|
|
|
if (o1 instanceof UserInOrganEntity && o2 instanceof UserInOrganEntity) { |
|
UserInOrganEntity s1 = (UserInOrganEntity) o1; |
|
UserInOrganEntity s2 = (UserInOrganEntity) o2; |
|
if (s1.getFullPathOrder().compareTo(s2.getFullPathOrder()) > 0) return 1; |
|
else if (s1.getFullPathOrder().compareTo(s2.getFullPathOrder()) < 0) return -1; |
|
else return 0; |
|
} |
|
|
|
return 0; |
|
} |
|
}
|
|
|