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

net.corda.core.contracts

## Class CommandAndState

- net.corda.core.contracts.CommandAndState

-     public class CommandAndState

  Return structure for `OwnableState.withNewOwner`

  See Also:
    `OwnableState.withNewOwner`

- - ### Constructor Detail

    - #### CommandAndState

          public CommandAndState(@NotNull
                                 CommandData command,
                                 @NotNull
                                 OwnableState ownableState)

      Return structure for `OwnableState.withNewOwner`

      See Also:
        `OwnableState.withNewOwner`

  - ### Method Detail

    - #### getCommand

          @NotNull
          public CommandData getCommand()

    - #### getOwnableState

          @NotNull
          public OwnableState getOwnableState()

    - #### component1

          @NotNull
          public CommandData component1()

    - #### component2

          @NotNull
          public OwnableState component2()

    - #### copy

          @NotNull
          public CommandAndState copy(@NotNull
                                               CommandData command,
                                               @NotNull
                                               OwnableState ownableState)

      Return structure for `OwnableState.withNewOwner`

      See Also:
        `OwnableState.withNewOwner`

    - #### toString

          @NotNull
          public java.lang.String toString()

      Return structure for `OwnableState.withNewOwner`

      See Also:
        `OwnableState.withNewOwner`

    - #### hashCode

          public int hashCode()

      Return structure for `OwnableState.withNewOwner`

      See Also:
        `OwnableState.withNewOwner`

    - #### equals

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

      Return structure for `OwnableState.withNewOwner`

      See Also:
        `OwnableState.withNewOwner`