Obligation.State - corda

corda / net.corda.finance.contracts.asset / Obligation / State

# State

`data class State<P : Any> : 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> | 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. `State(lifecycle: Lifecycle = Lifecycle.NORMAL, obligor: AbstractParty, template: Terms<P>, quantity: Long, beneficiary: AbstractParty)`

### Properties

#### amount | Amount represents a positive quantity of some issued product which can be cash, tokens, assets, or generally anything else that's quantifiable with integer quantities. See Issued and Amount for more details. `val amount: Amount<Issued<Terms<P>>>`
#### beneficiary | The public key of the entity the contract pays to `val beneficiary: AbstractParty`
#### bilateralNetState | 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. `val bilateralNetState: BilateralNetState<P>`
#### dueBefore | `val dueBefore: Instant`
#### exitKeys | 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. `val exitKeys: Collection<PublicKey>`
#### lifecycle | `var lifecycle: Lifecycle`
#### multilateralNetState | 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. `val multilateralNetState: MultilateralNetState<P>`
#### obligor | Where the debt originates from (obligor) `val obligor: AbstractParty`
#### owner | There must be a MoveCommand signed by this key to claim the amount. `val owner: AbstractParty`
#### participants | `val participants: List<AbstractParty>`
#### quantity | `val quantity: Long`
#### template | `val template: Terms<P>`

### Functions

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