Enum RequestParameter

java.lang.Object
java.lang.Enum<RequestParameter>
io.github.jdbcx.RequestParameter
All Implemented Interfaces:
Serializable, Comparable<RequestParameter>, java.lang.constant.Constable

public enum RequestParameter extends Enum<RequestParameter>
  • Enum Constant Details

  • Method Details

    • values

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

      public static RequestParameter valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • header

      public String header()
      Gets HTTP request header name in lower case.
      Returns:
      non-empty header name
    • parameter

      public String parameter()
      Gets query parameter name can be used in request URL.
      Returns:
      non-empty parameter name
    • defaultValue

      public String defaultValue()
      Gets default value of the parameter.
      Returns:
      non-null default value
    • getValue

      public String getValue(Map<String,String> headers, Map<String,String> params, String... defaultValues)
      Gets value of the query parameter by checking headers, params, and defaultValues in order. defaultValue() will be used if no value found in inputs.
      Parameters:
      headers - request headers
      params - query parameters in request URL
      defaultValues - default values
      Returns:
      non-null value of the query parameter