Class RequestParamsBuilder (2.43.0)

public class 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()

public static RequestParamsBuilder create()
Returns
TypeDescription
RequestParamsBuilder

Methods

add(String headerKey, String fieldValue)

public void add(String headerKey, String fieldValue)

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
NameDescription
headerKeyString

the header key for the routing header param

fieldValueString

the field value from a request

add(String fieldValue, String headerKey, PathTemplate pathTemplate)

public void add(String fieldValue, String headerKey, PathTemplate pathTemplate)

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
NameDescription
fieldValueString

the field value from a request

headerKeyString

the header key for the routing header param

pathTemplatecom.google.api.pathtemplate.PathTemplate

PathTemplate the path template used for match-and-extract

build()

public Map<String,String> build()
Returns
TypeDescription
Map<String,String>