net.corda.contracts.asset / Obligation / State

# State

`data class State<P> : FungibleAsset<Terms<P>>, NettableState<State<P>, MultilateralNetState<P>>`

A state representing the obligation of one party (obligor) to deliver a specified number of units of an underlying asset (described as token.acceptableIssuedProducts) to the beneficiary no later than the specified time.

### Parameters

`P` - the product the obligation is for payment of.

### Constructors

<init> | `State(lifecycle: Lifecycle = Lifecycle.NORMAL, obligor: Party, template: Terms<P>, quantity: Long, beneficiary: PublicKeyTree)` A state representing the obligation of one party (obligor) to deliver a specified number of units of an underlying asset (described as token.acceptableIssuedProducts) to the beneficiary no later than the specified time.

### Properties

amount | `val amount: Amount<Issued<Terms<P>>>`
beneficiary | `val beneficiary: PublicKeyTree` The public key of the entity the contract pays to
bilateralNetState | `val bilateralNetState: BilateralNetState<P>` Returns an object used to determine if two states can be subject to close-out netting. If two states return equal objects, they can be close out netted together.
contract | `val contract: Obligation<Currency>` An instance of the contract class that will verify this state.
dueBefore | `val dueBefore: Instant`
exitKeys | `val exitKeys: Collection<PublicKeyTree>` 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.
lifecycle | `var lifecycle: Lifecycle`
multilateralNetState | `val multilateralNetState: MultilateralNetState<P>` Returns an object used to determine if two states can be subject to close-out netting. If two states return equal objects, they can be close out netted together.
obligor | `val obligor: Party` Where the debt originates from (obligor)
owner | `val owner: PublicKeyTree` There must be a MoveCommand signed by this key to claim the amount
participants | `val participants: List<PublicKeyTree>` A participant is any party that is able to consume this state in a valid transaction.
quantity | `val quantity: Long`
template | `val template: Terms<P>`

### Functions

move | `fun move(newAmount: Amount<Issued<Terms<P>>>, newOwner: PublicKeyTree): State<P>`
net | `fun net(other: State<P>): State<P>` Perform bilateral netting of this state with another state. The two states must be compatible (as in bilateralNetState objects are equal).
toString | `fun toString(): String`
withNewOwner | `fun withNewOwner(newOwner: PublicKeyTree): <ERROR CLASS>` Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone

### Extension Functions

at | `infix fun <T> State<T>.at(dueBefore: Instant): State<T>`
between | `infix fun <T> State<T>.between(parties: <ERROR CLASS><Party, PublicKeyTree>): State<T>`
issued by | `infix fun <T> State<T>.issued by(party: Party): State<T>`
issuedBy | `fun <T> State<T>.issuedBy(party: Party): State<T>`
owned by | `infix fun <T> State<T>.owned by(owner: PublicKeyTree): State<T>`
ownedBy | `fun <T> State<T>.ownedBy(owner: PublicKeyTree): State<T>`