Class AnyState
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- io.contract_testing.contractcase.definitions.states.AnyState
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
InState,InStateWithVariables
@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-08-20T01:46:20.848Z") @Stability(Stable) public abstract class AnyState extends software.amazon.jsii.JsiiObject
The base class for all ContractCase State Descriptors. You shouldn't need to extend this.You don't need to read the documentation for this class unless you are working on a wrapper for ContractCase.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAnyState(String stateType, String stateName)The base class for all ContractCase State Descriptors.protectedAnyState(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedAnyState(software.amazon.jsii.JsiiObjectRef objRef)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetStateName()The name of this state, used to determine which state handler to run.Stringstringify()You shouldn't need to override this method.ObjecttoJSON()You shouldn't need to override or call this method.-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
AnyState
protected AnyState(software.amazon.jsii.JsiiObjectRef objRef)
-
AnyState
protected AnyState(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
AnyState
@Stability(Stable) protected AnyState(@NotNull String stateType, @NotNull String stateName)The base class for all ContractCase State Descriptors. You shouldn't need to extend this.You don't need to read the documentation for this class unless you are working on a wrapper for ContractCase.
- Parameters:
stateType- This parameter is required.stateName-- The name of the state used by this example.
-
-
Method Detail
-
stringify
@Stability(Stable) @NotNull public String stringify()
You shouldn't need to override this method.You don't need to call this method, unless working on a wrapper for ContractCase.
This method returns the entire state descriptor as a JSON string, as a convenience so that wrapper libraries don't need to figure out how to walk a tree of example objects.
- Returns:
- A JSON string representation of this state.
-
toJSON
@Stability(Stable) @NotNull public Object toJSON()
You shouldn't need to override or call this method.It exists because the ContractCase matcher format is not legal in all languages that ContractCase supports.
It isn't called by any implementation directly, it's used on the javascript side by
JSON.stringify().Calling it from a wrapper library will return unhelpful results, as JSii can't map all objects that it returns.
WARNING: Do not return a string from this method. You must instead return an object that can be serialised to JSON following the matcher format described in Extending ContractCase.
- Returns:
- An object in the matcher format described in the Extending ContractCase documentation.
-
getStateName
@Stability(Stable) @NotNull public String getStateName()
The name of this state, used to determine which state handler to run.
-
-