Class HttpStatusCode
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- io.contract_testing.contractcase.definitions.matchers.base.AnyMatcher
-
- io.contract_testing.contractcase.definitions.matchers.base.AnyMatcherWithExample
-
- io.contract_testing.contractcase.definitions.matchers.http.HttpStatusCode
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-08-20T01:46:20.845Z") @Stability(Stable) public class HttpStatusCode extends AnyMatcherWithExample
Matches an HTTP status code.
-
-
Constructor Summary
Constructors Modifier Constructor Description HttpStatusCode(Object statusCode)Matches an HTTP status code.protectedHttpStatusCode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedHttpStatusCode(software.amazon.jsii.JsiiObjectRef objRef)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjecttoJSON()For non-TypeScript implementations (seeAnyMatcher.toJSON).-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
HttpStatusCode
protected HttpStatusCode(software.amazon.jsii.JsiiObjectRef objRef)
-
HttpStatusCode
protected HttpStatusCode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
HttpStatusCode
@Stability(Stable) public HttpStatusCode(@NotNull Object statusCode)Matches an HTTP status code.Matching can be relaxed with `X`, eg `"4XX"` or `"5XX"`. This is useful for error handling. If you need to match multiple specific statues, you can provide an array of string or numbers. This behaviour is provided so that you can offer flexibility to the implementation if the code path for multiple status codes is exactly the same. It is not appropriate to use multiple status codes if the code paths are intended to be different. For more context, see {@link https://case.contract-testing.io/docs/faq#how-do-i-tell-contractcase-that-a-field-is-optional the section on optional values in the documentation} for more details.
- Parameters:
statusCode-- The http status code to match, expressed as a number or string (eg
200,"404"or"4XX").
- The http status code to match, expressed as a number or string (eg
-
-
Method Detail
-
toJSON
@Stability(Stable) @NotNull public Object toJSON()
For non-TypeScript implementations (seeAnyMatcher.toJSON).- Overrides:
toJSONin classAnyMatcherWithExample- Returns:
- An object in the matcher format described {@link https://case.contract-testing.io/docs/reference/plugin-framework in the Extending ContractCase documentation}
-
-