Codename One does not accept primitive types (int), so I'm trying to write the following comparator using Integer:
private static class CelebrityPopularityComparator implements Comparator<Celebrity> {
@Override
public int compare(Celebrity celebrity1, Celebrity celebrity2) {
Integer celebrity1PopularitySum = celebrity1.getCelebrityPopularitySum();
Integer celebrity2PopularitySum = celebrity2.getCelebrityPopularitySum();
Integer comparisonResult = Integer.valueOf(celebrity1PopularitySum.compareTo(celebrity2PopularitySum));
return comparisonResult;
}
}
I tried many ways and it just won't work. It won't send a build to the server. What can I do to fix it? Thanks!