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

com.github.panhongan.util.web.url.HTTPConstants Maven / Gradle / Ivy

There is a newer version: 0.1.8
Show newest version
package com.github.panhongan.util.web.url;

public class HTTPConstants {
	
	public static class Method {
		
		public static final Method GET = new Method("get");
		
		public static final Method PUT = new Method("put");
		
		public static final Method POST = new Method("post");
		
		public static final Method DELETE = new Method("delete");
		
		public static final Method HEAD = new Method("head");
		
		public static final Method TRACE = new Method("trace");
		
		public static final Method OPTIONS = new Method("options");
		
		public static final Method CONNECT = new Method("connect");
		
		private String method = null;
		
		private Method(String method) {
			this.method = method;
		}
		
		@Override
		public String toString() {
			return method;
		}
		
		@Override
		public boolean equals(Object obj) {
			boolean is_equal = false;
			
			if (method != null && obj != null) {
				if (obj instanceof Method) {
					is_equal = method.contentEquals(((Method)obj).method);
				} else if (obj instanceof String) {
					is_equal = method.contentEquals((String)obj);
				}
			}
			
			return is_equal;
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy