@DoNotImplement public class StatePointer<T extends ContractState>
A class StatePointer contains a pointer to a interface ContractState. The class StatePointer can be included in a interface ContractState
or included in an off-ledger data structure. class StatePointers can be resolved to a class StateAndRef by performing a
vault query. There are two types of pointers; linear and static. class LinearPointers are for use with interface LinearStates.
class StaticPointers are for use with any type of interface ContractState.
@NotNull public java.lang.Object getPointer()
An identifier for the interface ContractState that this class StatePointer points to.
interface ContractState,
class StatePointer@NotNull public java.lang.Class<T> getType()
Type of the state which is being pointed to.
public boolean isResolved()
Determines whether the state pointer should be resolved to a reference input when used in a transaction.
@NotNull public StateAndRef<T> resolve(@NotNull ServiceHub services)
Resolves a class StatePointer to a class StateAndRef via a vault query. This method will either return a class StateAndRef
or return an exception.
services - a interface ServiceHub implementation is required to resolve the pointer.class StatePointer,
class StateAndRef,
class StateAndRef@NotNull public StateAndRef<T> resolve(@NotNull LedgerTransaction ltx)
Resolves a class StatePointer to a class StateAndRef from inside a class LedgerTransaction. The intuition here is that all
of the pointed-to states will be included in the transaction as reference states.
ltx - the class LedgerTransaction containing the pointer and pointed-to states.class StatePointer,
class StateAndRef,
class LedgerTransaction