org.zodiac.sdk.nio.http.common.HTTPMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zodiac-sdk-nio Show documentation
Show all versions of zodiac-sdk-nio Show documentation
Zodiac SDK NIO2(New Non-Blocking IO)
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);
}
}
}