com.r3corda.contracts.asset / CommodityContract / State

# State

`data class State : FungibleAsset<Commodity>`

A state representing a commodity claim against some party

### Constructors

<init> | `State(deposit: PartyAndReference, amount: Amount<Commodity>, owner: PublicKey)``State(amount: Amount<Issued<Commodity>>, owner: PublicKey)` A state representing a commodity claim against some party

### Properties

amount | `val amount: Amount<Issued<Commodity>>`
contract | `val contract: CommodityContract` An instance of the contract class that will verify this state.
exitKeys | `val exitKeys: MutableSet<PublicKey>` 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.
owner | `val owner: PublicKey` There must be a MoveCommand signed by this key to claim the amount
participants | `val participants: <ERROR CLASS>` A participant is any party that is able to consume this state in a valid transaction.

### Functions

move | `fun move(newAmount: Amount<Issued<Commodity>>, newOwner: PublicKey): FungibleAsset<Commodity>`
toString | `fun toString(): String`
withNewOwner | `fun withNewOwner(newOwner: PublicKey): <ERROR CLASS>` Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone