public class StatePointer<T extends ContractState>
A class StatePointer
contains a StatePointer.getPointer
to a interface ContractState
. The class StatePointer
can be included in a interface ContractState
or included in an off-ledger data structure. class StatePointer
s can be resolved to a class StateAndRef
by performing a
vault query. There are two types of pointers; linear and static. class LinearPointer
s are for use with interface LinearState
s.
class StaticPointer
s are for use with any type of interface ContractState
.
Modifier and Type | Class and Description |
---|---|
static class |
StatePointer.Companion |
Modifier and Type | Field and Description |
---|---|
static StatePointer.Companion |
Companion |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getPointer()
An identifier for the
interface ContractState that this class StatePointer points to. |
java.lang.Class<T> |
getType()
Type of the state which is being pointed to.
|
boolean |
isResolved()
Determines whether the state pointer should be resolved to a reference input when used in a transaction.
|
StateAndRef<T> |
resolve(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. |
StateAndRef<T> |
resolve(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. |
public static StatePointer.Companion Companion
public java.lang.Object getPointer()
An identifier for the interface ContractState
that this class StatePointer
points to.
interface ContractState
,
class StatePointer
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.
public StateAndRef<T> resolve(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
public StateAndRef<T> resolve(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 StatePointer.getPointer
and pointed-to states.class StatePointer
,
class StateAndRef
,
class LedgerTransaction