Page

data class Page<T : ContractState> constructor(val states: List<StateAndRef<T>>, val statesMetadata: List<Vault.StateMetadata>, val totalStatesAvailable: Long, val stateTypes: Vault.StateStatus, val otherResults: List<Any>, val previousPageAnchor: StateRef? = null)

Returned in queries VaultService.queryBy and VaultService.trackBy. A Page contains:

  1. a List of actual StateAndRef requested by the specified QueryCriteria to a maximum of MAX_PAGE_SIZE.

  2. a List of associated Vault.StateMetadata, one per StateAndRef result.

  3. a total number of states that met the given QueryCriteria if a PageSpecification was provided, otherwise it defaults to -1.

  4. Status types used in this query: StateStatus.UNCONSUMED, StateStatus.CONSUMED, StateStatus.ALL.

  5. Other results as a List of any type (eg. aggregate function results with/without group by).

  6. A StateRef pointing to the last state of the previous page. Use this to detect if the database has changed whilst loading pages by checking it matches your last loaded state.

Note: currently otherResults is used only for aggregate functions (in which case, states and statesMetadata will be empty).

Constructors

Link copied to clipboard
constructor(states: List<StateAndRef<T>>, statesMetadata: List<Vault.StateMetadata>, totalStatesAvailable: Long, stateTypes: Vault.StateStatus, otherResults: List<Any>, previousPageAnchor: StateRef? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun copy(states: List<StateAndRef<T>> = this.states, statesMetadata: List<Vault.StateMetadata> = this.statesMetadata, totalStatesAvailable: Long = this.totalStatesAvailable, stateTypes: Vault.StateStatus = this.stateTypes, otherResults: List<Any> = this.otherResults): Vault.Page<T>