Authored by linlong

redis排序

... ... @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import java.util.*;
import java.util.logging.Logger;
/**
* Created by yoho on 2016/9/21.
... ... @@ -75,11 +76,11 @@ public class RedisMonitorCtrl {
Collections.sort(result, new Comparator<LinkedHashMap>() {
@Override
public int compare(LinkedHashMap o1, LinkedHashMap o2) {
String type1 = (String) o1.get("type");
String type2 = (String) o2.get("type");
if (type1.compareTo(type2)>0) {
String network1 = (String) o1.get("network");
String network2= (String) o2.get("network");
if (network1.compareTo(network2)>0) {
return 1;
}else if(type1.compareTo(type2)<0){
}else if(network1.compareTo(network2)<0){
return -1;
}
return 0;
... ...