package cn.config.mapping; import java.io.Serializable; /** * * @author yangsong * @date 2015/12/14 */ public class URIMappingKey implements Serializable{ private static final long serialVersionUID = 3743065992523011040L; private String uri; private String httpMethod; public URIMappingKey() { } public URIMappingKey(String uri, String httpMethod) { this.uri = uri; this.httpMethod = httpMethod; } public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } public String getHttpMethod() { return httpMethod; } public void setHttpMethod(String httpMethod) { this.httpMethod = httpMethod; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((httpMethod == null) ? 0 : httpMethod.hashCode()); result = prime * result + ((uri == null) ? 0 : uri.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; URIMappingKey other = (URIMappingKey) obj; if (httpMethod == null) { if (other.httpMethod != null) return false; } else if (!httpMethod.equals(other.httpMethod)) return false; if (uri == null) { if (other.uri != null) return false; } else if (!uri.equals(other.uri)) return false; return true; } }