Cash.State
Keywords: net.corda.finance.contracts.asset.Cash.State class
Date: 2023-09-18

net.corda.finance.contracts.asset

## Class Cash.State

- net.corda.finance.contracts.asset.Cash.State

- All Implemented Interfaces:
    ContractState, FungibleAsset<T>, FungibleState<T>, OwnableState, QueryableState
  Enclosing class:
    Cash

      public static class Cash.State
      implements FungibleAsset<T>, QueryableState

  A state representing a cash claim against some party.

- - ### Constructor Detail

    - #### State

          public State(@NotNull
                       Amount<net.corda.core.contracts.Issued> amount,
                       @NotNull
                       AbstractParty owner)

      A state representing a cash claim against some party.

      Parameters:
        `amount` - Amount represents a positive quantity of some issued product which can be cash, tokens, assets, or generallyanything else that's quantifiable with integer quantities. See `class Issued` and `class Amount` for more details.
        `owner` - There must be a MoveCommand signed by this key to claim the amount.

    - #### State

          public State(@NotNull
                       PartyAndReference deposit,
                       @NotNull
                       Amount<java.util.Currency> amount,
                       @NotNull
                       AbstractParty owner)

  - ### Method Detail

    - #### getExitKeys

          @NotNull
          public java.util.Set<java.security.PublicKey> getExitKeys()

      There must be an ExitCommand signed by these keys to destroy the amount. While all states require their owner to sign, some (i.e. cash) also require the issuer.

    - #### getParticipants

          @NotNull
          public java.util.List<net.corda.core.identity.AbstractParty> getParticipants()

      A participant is any party that should be notified when the state is created or consumed.

      The list of participants is required for certain types of transactions. For example, when changing the notary for this state, every participant has to be involved and approve the transaction so that they receive the updated state, and don't end up in a situation where they can no longer use a state they possess, since someone consumed that state during the notary change process.

      The participants list should normally be derived from the contents of the state.

    - #### withNewOwnerAndAmount

          @NotNull
          public FungibleAsset<java.util.Currency> withNewOwnerAndAmount(@NotNull
                                                                                  Amount<net.corda.core.contracts.Issued> newAmount,
                                                                                  @NotNull
                                                                                  AbstractParty newOwner)

      Copies the underlying data structure, replacing the amount and owner fields with the new values and leaving the rest (exitKeys) alone.

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### withNewOwner

          @NotNull
          public CommandAndState withNewOwner(@NotNull
                                                       AbstractParty newOwner)

      Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone.

    - #### ownedBy

          @NotNull
          public net.corda.finance.contracts.asset.Cash.State ownedBy(@NotNull
                                                                               AbstractParty owner)

    - #### issuedBy

          @NotNull
          public net.corda.finance.contracts.asset.Cash.State issuedBy(@NotNull
                                                                                AbstractParty party)

    - #### issuedBy

          @NotNull
          public net.corda.finance.contracts.asset.Cash.State issuedBy(@NotNull
                                                                                PartyAndReference deposit)

    - #### withDeposit

          @NotNull
          public net.corda.finance.contracts.asset.Cash.State withDeposit(@NotNull
                                                                                   PartyAndReference deposit)

    - #### generateMappedObject

          @NotNull
          public PersistentState generateMappedObject(@NotNull
                                                               MappedSchema schema)

      Object Relational Mapping support.

    - #### supportedSchemas

          @NotNull
          public java.lang.Iterable<net.corda.core.schemas.MappedSchema> supportedSchemas()

      Object Relational Mapping support.

    - #### getAmount

          @NotNull
          public Amount<net.corda.core.contracts.Issued> getAmount()

      Amount represents a positive quantity of some issued product which can be cash,

      tokens, assets, or generallyanything else that's quantifiable with integer quantities. See `class Issued` and `class Amount` for more details.

      See Also:
        `class Issued`, `class Amount`

    - #### getOwner

          @NotNull
          public AbstractParty getOwner()

      There must be a MoveCommand signed by this key to claim the amount.

    - #### component1

          @NotNull
          public Amount<net.corda.core.contracts.Issued> component1()

      Amount represents a positive quantity of some issued product which can be cash,

      tokens, assets, or generallyanything else that's quantifiable with integer quantities. See `class Issued` and `class Amount` for more details.

      See Also:
        `class Issued`, `class Amount`

    - #### component2

          @NotNull
          public AbstractParty component2()

      There must be a MoveCommand signed by this key to claim the amount.

    - #### copy

          @NotNull
          public net.corda.finance.contracts.asset.Cash.State copy(@NotNull
                                                                            Amount<net.corda.core.contracts.Issued> amount,
                                                                            @NotNull
                                                                            AbstractParty owner)

      A state representing a cash claim against some party.

    - #### hashCode

          public int hashCode()

      A state representing a cash claim against some party.

    - #### equals

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

      A state representing a cash claim against some party.