net.corda.core.node.services

## Class Vault<T extends ContractState>

- net.corda.core.node.services.Vault<T>

-     public class Vault<T extends ContractState>

  A vault (name may be temporary) wraps a set of states that are useful for us to keep track of, for instance, because we own them. This class represents an immutable, stable state of a vault: it is guaranteed not to change out from underneath you, even though the canonical currently-best-known vault may change as we learn about new transactions from our peers and generate new transactions that consume states ourselves.

  This abstract class has no references to Cash contracts.

  states Holds a `interface VaultService` queried subset of states that are active and relevant. Active means they haven't been consumed yet (or we don't know about it). Relevant means they contain at least one of our pubkeys.

  See Also:
    `interface VaultService`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Vault.Companion`
    `static class` | `Vault.Update` Represents an update observed by the vault that will be notified to observers. Include the `class StateRef`s of transaction outputs that were consumed (inputs) and the `interface ContractState`s produced (outputs) to/by the transaction or transactions observed and the vault.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Vault.Companion` | `Companion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Vault(java.lang.Iterable<? extends net.corda.core.contracts.StateAndRef<? extends T>> states)` A vault (name may be temporary) wraps a set of states that are useful for us to keep track of, for instance, because we own them. This class represents an immutable, stable state of a vault: it is guaranteed not to change out from underneath you, even though the canonical currently-best-known vault may change as we learn about new transactions from our peers and generate new transactions that consume states ourselves.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Iterable<net.corda.core.contracts.StateAndRef>` | `getStates()`

- - ### Field Detail

    - #### Companion

          public static Vault.Companion Companion

  - ### Constructor Detail

    - #### Vault

          public Vault(java.lang.Iterable<? extends net.corda.core.contracts.StateAndRef<? extends T>> states)

      A vault (name may be temporary) wraps a set of states that are useful for us to keep track of, for instance, because we own them. This class represents an immutable, stable state of a vault: it is guaranteed not to change out from underneath you, even though the canonical currently-best-known vault may change as we learn about new transactions from our peers and generate new transactions that consume states ourselves.

      This abstract class has no references to Cash contracts.

      states Holds a `interface VaultService` queried subset of states that are active and relevant. Active means they haven't been consumed yet (or we don't know about it). Relevant means they contain at least one of our pubkeys.

      See Also:
        `interface VaultService`

  - ### Method Detail

    - #### getStates

          public java.lang.Iterable<net.corda.core.contracts.StateAndRef> getStates()