StaticPointer - corda

corda / net.corda.core.contracts / StaticPointer

# StaticPointer

`class StaticPointer<T : ContractState> : StatePointer<T>`

A StaticPointer contains a pointer to a specific StateRef and can be resolved by looking up the StateRef via ServiceHub. There are a number of things to keep in mind when using StaticPointers:

- The ContractState being pointed to may be spent or unspent when the pointer is resolved
- The ContractState may not be known by the node performing the look-up in which case the resolve method will throw a TransactionResolutionException

### Constructors

#### <init> | Allows this class to be evolved through backwards compatibility with version 1 of this class. `StaticPointer(pointer: StateRef, type: Class<T>)` A StaticPointer contains a pointer to a specific StateRef and can be resolved by looking up the StateRef via ServiceHub. There are a number of things to keep in mind when using StaticPointers: `StaticPointer(pointer: StateRef, type: Class<T>, isResolved: Boolean = false)`

### 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: StateRef`
#### 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 StaticPointer to a StateAndRef via a StateRef look-up. `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>`