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

com.litongjava.tio.http.common.HttpMethod Maven / Gradle / Ivy

There is a newer version: 3.7.3.v20241201-RELEASE
Show newest version
package com.litongjava.tio.http.common;

/**
 * @author tanyaowu 2017年6月28日 下午2:23:16
 */
public enum HttpMethod {
  GET("GET"), POST("POST"), HEAD("HEAD"),
  //
  PUT("PUT"), DELETE("DELETE"),
  //
  TRACE("TRACE"), OPTIONS("OPTIONS"), PATCH("PATCH");

  public static HttpMethod from(String method) {
    if (method == null) {
      return null;
    }
    switch (method) {
    case "GET":
      return GET;
    case "POST":
      return POST;
    case "HEAD":
      return HEAD;
    case "PUT":
      return PUT;
    case "DELETE":
      return DELETE;
    case "TRACE":
      return TRACE;
    case "OPTIONS":
      return OPTIONS;
    case "PATCH":
      return PATCH;
    default:
      return null;
    }
  }

  String value;

  private HttpMethod(String value) {
    this.value = value;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy