Class HttpRequestExample.Builder
- java.lang.Object
-
- io.contract_testing.contractcase.definitions.matchers.http.HttpRequestExample.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<HttpRequestExample>
- Enclosing interface:
- HttpRequestExample
@Stability(Stable) public static final class HttpRequestExample.Builder extends Object implements software.amazon.jsii.Builder<HttpRequestExample>
A builder forHttpRequestExample
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRequestExample.Builderbody(Object body)Sets the value ofHttpRequestExample.getBody()HttpRequestExamplebuild()Builds the configured instance.HttpRequestExample.Builderheaders(Object headers)Sets the value ofHttpRequestExample.getHeaders()HttpRequestExample.Buildermethod(Object method)Sets the value ofHttpRequestExample.getMethod()HttpRequestExample.Builderpath(Object path)Sets the value ofHttpRequestExample.getPath()HttpRequestExample.Builderquery(Object query)Sets the value ofHttpRequestExample.getQuery()HttpRequestExample.BuilderuniqueName(String uniqueName)Sets the value ofHttpRequestExample.getUniqueName()
-
-
-
Method Detail
-
method
@Stability(Stable) public HttpRequestExample.Builder method(Object method)
Sets the value ofHttpRequestExample.getMethod()- Parameters:
method- A string or string matcher that matches the method used for this example (eg"GET"or"POST"). This parameter is required. Case insensitive. Note that DELETE, GET and HEAD requests should not have bodies - see the HTTP RFCs for details.- Returns:
this
-
path
@Stability(Stable) public HttpRequestExample.Builder path(Object path)
Sets the value ofHttpRequestExample.getPath()- Parameters:
path- A string or string matcher that matches the path of this example. This parameter is required. Note that any query parameters must be in the query, not in the path.- Returns:
this
-
body
@Stability(Stable) public HttpRequestExample.Builder body(Object body)
Sets the value ofHttpRequestExample.getBody()- Parameters:
body- A test equivalence matcher or json object that describes the body for this response. If not provided, no body matching is performed.- Returns:
this
-
headers
@Stability(Stable) public HttpRequestExample.Builder headers(Object headers)
Sets the value ofHttpRequestExample.getHeaders()- Parameters:
headers- A Map of header names and associated test-equivalence matcher values accepted by this example. If not provided, no header matching is performed- Returns:
this
-
query
@Stability(Stable) public HttpRequestExample.Builder query(Object query)
Sets the value ofHttpRequestExample.getQuery()- Parameters:
query- A test-equivalence matcher for the query. Usually this is a Map of test-equivalence matchers to match the parsed query string, keyed by parameter name. Repeated parameters are collated and put in an array in this map.- Returns:
this
-
uniqueName
@Stability(Stable) public HttpRequestExample.Builder uniqueName(String uniqueName)
Sets the value ofHttpRequestExample.getUniqueName()- Parameters:
uniqueName- What unique name, if any, to give to this request.- Returns:
this
-
build
@Stability(Stable) public HttpRequestExample build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<HttpRequestExample>- Returns:
- a new instance of
HttpRequestExample - Throws:
NullPointerException- if any required attribute was not provided
-
-