Class 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.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

        software.amazon.jsii.JsiiObject.InitializationMode
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AnyState​(String stateType, String stateName)
      The base class for all ContractCase State Descriptors.
      protected AnyState​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)  
      protected AnyState​(software.amazon.jsii.JsiiObjectRef objRef)  
    • 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.
        This parameter is required.
    • 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.