State

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

Link copied to clipboard
constructor(lifecycle: Obligation.Lifecycle = Lifecycle.NORMAL, obligor: AbstractParty, template: Obligation.Terms<P>, quantity: Long, beneficiary: AbstractParty)

Properties

Link copied to clipboard
open override val amount: Amount<Issued<Obligation.Terms<P>>>

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.

Link copied to clipboard

The public key of the entity the contract pays to

Link copied to clipboard

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.

Link copied to clipboard
Link copied to clipboard
open override val exitKeys: Collection<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.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

Where the debt originates from (obligor)

Link copied to clipboard
open override val owner: AbstractParty

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

Link copied to clipboard
open override val participants: List<AbstractParty>

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

Link copied to clipboard
Link copied to clipboard

Obtain the typename of the required ContractClass associated with the target ContractState, using the BelongsToContract annotation by default, but falling through to checking the state's enclosing class if there is one and it inherits from Contract.

Link copied to clipboard

Functions

Link copied to clipboard
infix fun <T : Any> Obligation.State<T>.at(dueBefore: Instant): Obligation.State<T>
Link copied to clipboard
infix fun <T : Any> Obligation.State<T>.between(parties: <Error class: unknown class><AbstractParty, AbstractParty>): Obligation.State<T>
Link copied to clipboard

Returns the SHA-256 hash of the serialised contents of this state (not cached!)

Returns the hash of the serialised contents of this state (not cached!)

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun net(other: Obligation.State<P>): Obligation.State<P>

Perform bilateral netting of this state with another state. The two states must be compatible (as in bilateralNetState objects are equal).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun withNewOwner(newOwner: AbstractParty): CommandAndState

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

Link copied to clipboard

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