Class HttpResponseExample.Builder
- java.lang.Object
-
- io.contract_testing.contractcase.definitions.matchers.http.HttpResponseExample.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<HttpResponseExample>
- Enclosing interface:
- HttpResponseExample
@Stability(Stable) public static final class HttpResponseExample.Builder extends Object implements software.amazon.jsii.Builder<HttpResponseExample>
A builder forHttpResponseExample
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpResponseExample.Builderbody(Object body)Sets the value ofHttpResponseExample.getBody()HttpResponseExamplebuild()Builds the configured instance.HttpResponseExample.Builderheaders(Object headers)Sets the value ofHttpResponseExample.getHeaders()HttpResponseExample.Builderstatus(Object status)Sets the value ofHttpResponseExample.getStatus()HttpResponseExample.BuilderuniqueName(String uniqueName)Sets the value ofHttpResponseExample.getUniqueName()
-
-
-
Method Detail
-
status
@Stability(Stable) public HttpResponseExample.Builder status(Object status)
Sets the value ofHttpResponseExample.getStatus()- Parameters:
status- Any test-equivalence matcher, string, or number for the HTTP status code accepted by this example (Recommended: Use theHttpStatusCodematcher). This parameter is required.- Returns:
this
-
body
@Stability(Stable) public HttpResponseExample.Builder body(Object body)
Sets the value ofHttpResponseExample.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 HttpResponseExample.Builder headers(Object headers)
Sets the value ofHttpResponseExample.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
-
uniqueName
@Stability(Stable) public HttpResponseExample.Builder uniqueName(String uniqueName)
Sets the value ofHttpResponseExample.getUniqueName()- Parameters:
uniqueName- What unique name, if any, to give to this response.- Returns:
this
-
build
@Stability(Stable) public HttpResponseExample build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<HttpResponseExample>- Returns:
- a new instance of
HttpResponseExample - Throws:
NullPointerException- if any required attribute was not provided
-
-