blob: 9f7225812c9485be7e3d53268b395682e6be3547 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package cgeo.geocaching.sorting;
import org.apache.commons.lang3.StringUtils;
import cgeo.geocaching.cgCache;
/**
* sorts caches by name
*
*/
public class NameComparator extends AbstractCacheComparator {
@Override
protected boolean canCompare(cgCache cache1, cgCache cache2) {
return StringUtils.isNotBlank(cache1.name) && StringUtils.isNotBlank(cache2.name);
}
@Override
protected int compareCaches(cgCache cache1, cgCache cache2) {
return cache1.name.compareToIgnoreCase(cache2.name);
}
}
|