corda / net.corda.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: CompositeKey)``State(amount: Amount<Issued<Commodity>>, owner: CompositeKey)` 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<CompositeKey>` 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: CompositeKey` There must be a MoveCommand signed by this key to claim the amount
participants | `val participants: List<CompositeKey>` 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: CompositeKey): FungibleAsset<Commodity>`
toString | `fun toString(): String`
withNewOwner | `fun withNewOwner(newOwner: CompositeKey): Pair<Move, State>` Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone