Package com.sap.cds.services.request
Interface ParameterInfo
- All Known Subinterfaces:
ModifiableParameterInfo
public interface ParameterInfo
Interface to access request-specific information.
For example, if the request is processed by a HTTP-based protocol adapter these methods provide access to the HTTP request.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ModifiableParameterInfo
copy()
Creates aModifiableParameterInfo
based on thisParameterInfo
.static ModifiableParameterInfo
create()
Creates aModifiableUserInfo
based on default values of a clearParameterInfo
.default String
default String
Returns the value of a header with the given identifier.Returns the header values asMap
.default Locale
default String
getQueryParameter
(String key) Returns the value of a query parameter with the given keyReturns the query parameter values asMap
.default Instant
default Instant
-
Method Details
-
create
Creates aModifiableUserInfo
based on default values of a clearParameterInfo
.- Returns:
- The created
ModifiableUserInfo
instance.
-
getCorrelationId
- Returns:
- the correlation id
-
getHeader
Returns the value of a header with the given identifier. In case the header withid
has several values, the result contains the values comma-separated.- Parameters:
id
- the header identifier- Returns:
- the value of the header
-
getHeaders
Returns the header values asMap
. Note that this might be an expensive operation.- Returns:
- the header values as
Map
.
-
getQueryParameter
Returns the value of a query parameter with the given key- Parameters:
key
- the query parameter key- Returns:
- the value of the query parameter
-
getQueryParams
Returns the query parameter values asMap
. Note that this might be an expensive operation.- Returns:
- the query parameter values as
Map
.
-
getLocale
- Returns:
- the preferred
Locale
set by the request
-
getValidFrom
- Returns:
- parsed
Instant
value of request parameter "valid-from" or constructed fromLong.MIN_VALUE
if not available or parsing failed.
-
getValidTo
- Returns:
- parsed
Instant
value of request parameter "valid-to" or constructed fromLong.MAX_VALUE
if not available or parsing failed.
-
copy
Creates aModifiableParameterInfo
based on thisParameterInfo
.- Returns:
- The created
ModifiableParameterInfo
instance.
-