Class BraveVerticalSearchRequest
java.lang.Object
net.ygbstudio.jbrave.core.builders.AbstractBraveRequestBuilder<BraveVerticalSearchRequest>
net.ygbstudio.jbrave.core.builders.BraveVerticalSearchRequest
- All Implemented Interfaces:
BraveVerticalRequest,VerticalHeaderBuilder<BraveVerticalRequest>
public final class BraveVerticalSearchRequest
extends AbstractBraveRequestBuilder<BraveVerticalSearchRequest>
implements BraveVerticalRequest
Builds a Brave vertical search request.
It configures the request URI and the standard request headers (user agent, cache control, API
version, and subscription token) and builds the underlying HttpRequest.
Clients typically configure vertical search requests through the query builders'
withHeaders consumers, which receive this builder as a VerticalHeaderBuilder typed with
BraveVerticalRequest.
Instances are created with builder() and can be reused after calling AbstractBraveRequestBuilder.clear().
-
Field Summary
Fields inherited from class net.ygbstudio.jbrave.core.builders.AbstractBraveRequestBuilder
headers, headersAttached, internalRequestBuilder, requestURI -
Method Summary
Modifier and TypeMethodDescriptionstatic BraveVerticalSearchRequestbuilder()Creates a new instance ofBraveVerticalSearchRequest.queryAddress(URI uri) Sets the URI for the request.withApiVersion(String apiVersion) Adds an API version header to the request.withCacheControl(String cacheControl) Adds a cache control header to the request.Adds a brave subscription token header to the request.withUserAgent(String userAgent) Adds a user agent header to the request.Methods inherited from class net.ygbstudio.jbrave.core.builders.AbstractBraveRequestBuilder
addHeader, attachHeaders, build, clear, clearRetainURI, queryURI, self, subscriptionMissing
-
Method Details
-
builder
Creates a new instance ofBraveVerticalSearchRequest.- Returns:
- a new instance of
BraveVerticalSearchRequest
-
queryAddress
Sets the URI for the request.- Parameters:
uri- the request URI- Returns:
- the current instance of
BraveVerticalSearchRequest
-
withUserAgent
Adds a user agent header to the request.- Specified by:
withUserAgentin interfaceVerticalHeaderBuilder<BraveVerticalRequest>- Parameters:
userAgent- the user agent value to set- Returns:
- the current instance of
BraveVerticalSearchRequest
-
withCacheControl
Adds a cache control header to the request.- Specified by:
withCacheControlin interfaceVerticalHeaderBuilder<BraveVerticalRequest>- Parameters:
cacheControl- the cache control value to set- Returns:
- the current instance of
BraveVerticalSearchRequest
-
withApiVersion
Adds an API version header to the request.- Specified by:
withApiVersionin interfaceVerticalHeaderBuilder<BraveVerticalRequest>- Parameters:
apiVersion- the API version value to set- Returns:
- the current instance of
BraveVerticalSearchRequest
-
withToken
Adds a brave subscription token header to the request.- Parameters:
subscriptionToken- the subscription token to set- Returns:
- the current instance of
BraveVerticalSearchRequest
-