Enum Class RestHttpMethod

java.lang.Object
java.lang.Enum<RestHttpMethod>
com.bonitasoft.processbuilder.enums.RestHttpMethod
All Implemented Interfaces:
Serializable, Comparable<RestHttpMethod>, Constable

public enum RestHttpMethod extends Enum<RestHttpMethod>
Defines the supported HTTP methods for REST service calls.
Since:
1.0
Author:
Bonitasoft
  • Enum Constant Details

    • GET

      public static final RestHttpMethod GET
      HTTP GET method for retrieving resources.
    • POST

      public static final RestHttpMethod POST
      HTTP POST method for creating resources.
    • PUT

      public static final RestHttpMethod PUT
      HTTP PUT method for replacing resources.
    • PATCH

      public static final RestHttpMethod PATCH
      HTTP PATCH method for partial updates.
    • DELETE

      public static final RestHttpMethod DELETE
      HTTP DELETE method for removing resources.
    • OPTIONS

      public static final RestHttpMethod OPTIONS
      HTTP OPTIONS method for retrieving allowed methods.
  • Method Details

    • values

      public static RestHttpMethod[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RestHttpMethod valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getKey

      public String getKey()
      Gets the HTTP method name.
      Returns:
      The method name (e.g., "GET", "POST")
    • getDescription

      public String getDescription()
      Gets a brief description of the HTTP method.
      Returns:
      The description
    • supportsBody

      public boolean supportsBody()
      Checks if this HTTP method typically supports a request body.
      Returns:
      true if the method supports a body
    • isValid

      public static boolean isValid(String input)
      Checks if a given string corresponds to a valid HTTP method.
      Parameters:
      input - The string to validate (case-insensitive)
      Returns:
      true if the string is a valid HTTP method
    • fromKey

      public static Optional<RestHttpMethod> fromKey(String key)
      Finds an HTTP method by its key (case-insensitive).
      Parameters:
      key - The key to search for
      Returns:
      Optional containing the matching method, or empty if not found
    • getAllData

      public static Map<String,String> getAllData()
      Retrieves all HTTP methods as a read-only Map.
      Returns:
      A map containing all method data (Key -> Description)
    • getAllKeysList

      public static List<String> getAllKeysList()
      Retrieves all method keys as a read-only List.
      Returns:
      A list containing all HTTP method names