HttpEnum

package com.yd.ifm.client.caller.util.http;

public class HttpEnum {
    
    public enum DefContentTypeEnum implements ContentTypeEnum{
        F("application/x-www-form-urlencoded"),
        J("application/json"),
        X("application/xml");
        private String type;
        
        private DefContentTypeEnum(String contentType){
            this.type = contentType;
        }
        
        public String getType(){
            return type;
        }
    }
    
    public interface ContentTypeEnum{
        String getType();
    }
    
    public enum RequestMethodEnum{
        POST("POST");
        private String method;
        
        private RequestMethodEnum(String method){
            this.method = method;
        }
        
        public String getMethod(){
            return method;
        }
    }
}

ContentTypeEnum contentType = DefContentTypeEnum.valueOf(

"application/x-www-form-urlencoded"

);

posted @ 2017-09-15 11:06  tonggc1668  阅读(204)  评论(0编辑  收藏  举报