All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.dreampie.security.credential.CredentialASC Maven / Gradle / Ivy

package cn.dreampie.security.credential;

import java.io.Serializable;
import java.util.Comparator;

/**
 * Created by wangrenhui on 15/4/25.
 * 升序的Set
 */
public class CredentialASC implements Comparator, Serializable {
  public int compare(Credential a, Credential b) {
    int result = a.getAntPath().length() - b.getAntPath().length();
    if (result == 0) {
      result = a.getHttpMethod().compareTo(b.getHttpMethod());
      if (result == 0) {
        return a.getAntPath().compareTo(b.getAntPath());
      }
    }
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy