corda / net.corda.core.contracts / LinearPointer

LinearPointer

class LinearPointer<T : LinearState> : StatePointer<T>

LinearPointer allows a ContractState to "point" to another LinearState creating a "many-to-one" relationship between all the states containing the pointer to a particular LinearState and the LinearState being pointed to. Using the LinearPointer is useful when one state depends on the data contained within another state that evolves independently. When using LinearPointer it is worth noting:

Constructors

<init>

Allows this class to be evolved through backwards compatibility with version 1 of this class.

LinearPointer(pointer: UniqueIdentifier, type: Class<T>)

LinearPointer allows a ContractState to "point" to another LinearState creating a "many-to-one" relationship between all the states containing the pointer to a particular LinearState and the LinearState being pointed to. Using the LinearPointer is useful when one state depends on the data contained within another state that evolves independently. When using LinearPointer it is worth noting:

LinearPointer(pointer: UniqueIdentifier, type: Class<T>, isResolved: Boolean = true)

Properties

isResolved

Determines whether the state pointer should be resolved to a reference input when used in a transaction.

val isResolved: Boolean

pointer

An identifier for the ContractState that this StatePointer points to.

val pointer: UniqueIdentifier

type

Type of the state which is being pointed to.

val type: Class<T>

Functions

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

resolve

Resolves a LinearPointer using the UniqueIdentifier contained in the pointer property. Returns a StateAndRef containing the latest version of the LinearState that the node calling resolve is aware of.

fun resolve(services: ServiceHub): StateAndRef<T>

Resolves a StatePointer to a StateAndRef from inside a LedgerTransaction. The intuition here is that all of the pointed-to states will be included in the transaction as reference states.

fun resolve(ltx: LedgerTransaction): StateAndRef<T>