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

org.zodiac.sdk.nio.http.common.HTTPMethod Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.sdk.nio.http.common;

public enum HTTPMethod {
    GET,
    POST;

    public static HTTPMethod of(final String value) {
        String _value = value;
        if (null == _value) {
            throw new IllegalArgumentException("Invalid http method specified: " + value);
        }
        _value = _value.trim().toUpperCase();
        if (0 == _value.length()) {
            throw new IllegalArgumentException("Invalid http method specified: " + value);
        }
        switch (value) {
            case "GET":
            //case "get":
                return GET;
            case "POST":
            //case "post":
                return POST;
            default:
                throw new IllegalArgumentException("Invalid http method specified: " + value);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy