Class RequestParamsBuilder (2.35.0)

publicclass RequestParamsBuilder

This builder class builds a request params map that will be used by autogenerated implementation of RequestParamsExtractor.

Inheritance

java.lang.Object > RequestParamsBuilder

Static Methods

create()

publicstaticRequestParamsBuildercreate()
Returns
Type Description
RequestParamsBuilder

Methods

add(String headerKey, String fieldValue)

publicvoidadd(StringheaderKey,StringfieldValue)

Add an entry to paramsBuilder with key-value pairing of (headerKey, fieldValue). The only validation done is to ensure the headerKey and fieldValue are not null and non-empty. This method is used for implicit routing headers (backwards compatibility).

Parameters
Name Description
headerKey String

the header key for the routing header param

fieldValue String

the field value from a request

add(String fieldValue, String headerKey, PathTemplate pathTemplate)

publicvoidadd(StringfieldValue,StringheaderKey,PathTemplatepathTemplate)

Add an entry to paramsBuilder by match-and-extract field values from requests based on pre-configured path templates. This method is called repeatedly for each configured routing rule parameter, it's possible that the incoming field value from request is null or there is no matches found, we'll continue the match-and-extract process for the next routing rule parameter in such case.

Parameters
Name Description
fieldValue String

the field value from a request

headerKey String

the header key for the routing header param

pathTemplate com.google.api.pathtemplate.PathTemplate

PathTemplate the path template used for match-and-extract

build()

publicMap<String,String>build()
Returns
Type Description
Map<String,String>

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.