Class HttpResponse.Builder
- java.lang.Object
-
- io.contract_testing.contractcase.definitions.matchers.http.HttpResponse.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<HttpResponse>
- Enclosing class:
- HttpResponse
@Stability(Stable) public static final class HttpResponse.Builder extends Object implements software.amazon.jsii.Builder<HttpResponse>
A fluent builder forHttpResponse.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpResponse.Builderbody(Object body)A test equivalence matcher or json object that describes the body for this response.HttpResponsebuild()static HttpResponse.Buildercreate()HttpResponse.Builderheaders(Object headers)A Map of header names and associated test-equivalence matcher values accepted by this example.HttpResponse.Builderstatus(Object status)Any test-equivalence matcher, string, or number for the HTTP status code accepted by this example (Recommended: Use theHttpStatusCodematcher).HttpResponse.BuilderuniqueName(String uniqueName)What unique name, if any, to give to this response.
-
-
-
Method Detail
-
create
@Stability(Stable) public static HttpResponse.Builder create()
- Returns:
- a new instance of
HttpResponse.Builder.
-
status
@Stability(Stable) public HttpResponse.Builder status(Object status)
Any test-equivalence matcher, string, or number for the HTTP status code accepted by this example (Recommended: Use theHttpStatusCodematcher).- 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 HttpResponse.Builder body(Object body)
A test equivalence matcher or json object that describes the body for this response.If not provided, no body matching is performed.
- Parameters:
body- A test equivalence matcher or json object that describes the body for this response. This parameter is required.- Returns:
this
-
headers
@Stability(Stable) public HttpResponse.Builder headers(Object headers)
A Map of header names and associated test-equivalence matcher values accepted by this example.If not provided, no header matching is performed
- Parameters:
headers- A Map of header names and associated test-equivalence matcher values accepted by this example. This parameter is required.- Returns:
this
-
uniqueName
@Stability(Stable) public HttpResponse.Builder uniqueName(String uniqueName)
What unique name, if any, to give to this response.- Parameters:
uniqueName- What unique name, if any, to give to this response. This parameter is required.- Returns:
this
-
build
@Stability(Stable) public HttpResponse build()
- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<HttpResponse>- Returns:
- a newly built instance of
HttpResponse.
-
-