Package io.github.jdbcx
Enum RequestParameter
- All Implemented Interfaces:
Serializable,Comparable<RequestParameter>,java.lang.constant.Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAgent or client of the request.Preferred encoding or compression of response.Preferred MIME type of response.QueryModeof the request.Query.Unique ID of the query.Tenant ID.Transaction ID.User who created the request. -
Method Summary
Modifier and TypeMethodDescriptionGets default value of the parameter.Gets value of the query parameter by checkingheaders,params, anddefaultValuesin order.header()Gets HTTP request header name in lower case.Gets query parameter name can be used in request URL.static RequestParameterReturns the enum constant of this type with the specified name.static RequestParameter[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
AGENT
Agent or client of the request. -
COMPRESSION
Preferred encoding or compression of response. -
FORMAT
Preferred MIME type of response. -
QUERY
Query. -
QUERY_ID
Unique ID of the query. -
MODE
QueryModeof the request. -
TENANT_ID
Tenant ID. -
TRANSACTION_ID
Transaction ID. -
USER
User who created the request.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
header
Gets HTTP request header name in lower case.- Returns:
- non-empty header name
-
parameter
Gets query parameter name can be used in request URL.- Returns:
- non-empty parameter name
-
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 checkingheaders,params, anddefaultValuesin order.defaultValue()will be used if no value found in inputs.- Parameters:
headers- request headersparams- query parameters in request URLdefaultValues- default values- Returns:
- non-null value of the query parameter
-