StateAndContract
Keywords: net.corda.core.contracts.StateAndContract class
Date: 2023-09-18

net.corda.core.contracts

## Class StateAndContract

- net.corda.core.contracts.StateAndContract

-     public class StateAndContract

  A convenience class for passing around a state and it's contract

- - ### Constructor Detail

    - #### StateAndContract

          public StateAndContract(@NotNull
                                  ContractState state,
                                  @NotNull
                                  java.lang.String contract)

      A convenience class for passing around a state and it's contract

      Parameters:
        `state` - A state
        `contract` - The contract that should verify the state

  - ### Method Detail

    - #### getState

          @NotNull
          public ContractState getState()

      A state

    - #### getContract

          @NotNull
          public java.lang.String getContract()

      The contract that should verify the state

    - #### component1

          @NotNull
          public ContractState component1()

      A state

    - #### component2

          @NotNull
          public java.lang.String component2()

      The contract that should verify the state

    - #### copy

          @NotNull
          public StateAndContract copy(@NotNull
                                                ContractState state,
                                                @NotNull
                                                java.lang.String contract)

      A convenience class for passing around a state and it's contract

    - #### toString

          @NotNull
          public java.lang.String toString()

      A convenience class for passing around a state and it's contract

    - #### hashCode

          public int hashCode()

      A convenience class for passing around a state and it's contract

    - #### equals

          public boolean equals(@Nullable
                                java.lang.Object p)

      A convenience class for passing around a state and it's contract