Vault.Update
Keywords: net.corda.core.node.services.Vault.Update class
Date: 2023-09-18

net.corda.core.node.services

## Class Vault.Update<U extends ContractState>

- net.corda.core.node.services.Vault.Update<U>

- Enclosing class:
    Vault<T extends ContractState>

      public static class Vault.Update<U extends ContractState>

  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.

  If the vault observes multiple transactions simultaneously, where some transactions consume the outputs of some of the other transactions observed, then the changes are observed "net" of those.

  See Also:
    `class StateRef`, `interface ContractState`

- - ### Constructor Detail

    - #### Update

          @JvmOverloads
          public Update(@NotNull
                                      java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> consumed,
                                      @NotNull
                                      java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> produced,
                                      @Nullable
                                      java.util.UUID flowId,
                                      @NotNull
                                      net.corda.core.node.services.Vault.UpdateType type,
                                      @NotNull
                                      java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> references)

      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.

      If the vault observes multiple transactions simultaneously, where some transactions consume the outputs of some of the other transactions observed, then the changes are observed "net" of those.

      Parameters:
        `type` - Specifies the type of update, currently supported types are general and, contract upgrade and notary change.Notary change transactions only modify the notary field on states, and potentially need to be handleddifferently.
      See Also:
        `class StateRef`, `interface ContractState`

    - #### Update

          @JvmOverloads
          public Update(@NotNull
                                      java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> consumed,
                                      @NotNull
                                      java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> produced,
                                      @Nullable
                                      java.util.UUID flowId,
                                      @NotNull
                                      net.corda.core.node.services.Vault.UpdateType type)

      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.

      If the vault observes multiple transactions simultaneously, where some transactions consume the outputs of some of the other transactions observed, then the changes are observed "net" of those.

      Parameters:
        `type` - Specifies the type of update, currently supported types are general and, contract upgrade and notary change.Notary change transactions only modify the notary field on states, and potentially need to be handleddifferently.
      See Also:
        `class StateRef`, `interface ContractState`

    - #### Update

          @JvmOverloads
          public Update(@NotNull
                                      java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> consumed,
                                      @NotNull
                                      java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> produced,
                                      @Nullable
                                      java.util.UUID flowId)

      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.

      If the vault observes multiple transactions simultaneously, where some transactions consume the outputs of some of the other transactions observed, then the changes are observed "net" of those.

      See Also:
        `class StateRef`, `interface ContractState`

    - #### Update

          @JvmOverloads
          public Update(@NotNull
                                      java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> consumed,
                                      @NotNull
                                      java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> produced)

      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.

      If the vault observes multiple transactions simultaneously, where some transactions consume the outputs of some of the other transactions observed, then the changes are observed "net" of those.

      See Also:
        `class StateRef`, `interface ContractState`

  - ### Method Detail

    - #### containsType

          public <T extends ContractState> boolean containsType(@NotNull
                                                                java.lang.Class<T> clazz,
                                                                @NotNull
                                                                net.corda.core.node.services.Vault.StateStatus status)

      Checks whether the update contains a state of the specified type and state status

    - #### isEmpty

          public boolean isEmpty()

    - #### plus

          @NotNull
          public net.corda.core.node.services.Vault.Update<U> plus(@NotNull
                                                                            net.corda.core.node.services.Vault.Update<U> rhs)

      Combine two updates into a single update with the combined inputs and outputs of the two updates but net any outputs of the left-hand-side (this) that are consumed by the inputs of the right-hand-side (rhs).

      i.e. the net effect in terms of state live-ness of receiving the combined update is the same as receiving this followed by rhs.

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### copy

          @NotNull
          public net.corda.core.node.services.Vault.Update<U> copy(@NotNull
                                                                            java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> consumed,
                                                                            @NotNull
                                                                            java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> produced,
                                                                            @Nullable
                                                                            java.util.UUID flowId,
                                                                            @NotNull
                                                                            net.corda.core.node.services.Vault.UpdateType type)

      Additional copy method to maintain backwards compatibility.

    - #### getConsumed

          @NotNull
          public java.util.Set<net.corda.core.contracts.StateAndRef> getConsumed()

    - #### getProduced

          @NotNull
          public java.util.Set<net.corda.core.contracts.StateAndRef> getProduced()

    - #### getFlowId

          @Nullable
          public java.util.UUID getFlowId()

    - #### getType

          @NotNull
          public net.corda.core.node.services.Vault.UpdateType getType()

      Specifies the type of update,

      currently supported types are general and, contract upgrade and notary change.Notary change transactions only modify the notary field on states, and potentially need to be handleddifferently.

    - #### getReferences

          @NotNull
          public java.util.Set<net.corda.core.contracts.StateAndRef> getReferences()

    - #### component1

          @NotNull
          public java.util.Set<net.corda.core.contracts.StateAndRef> component1()

    - #### component2

          @NotNull
          public java.util.Set<net.corda.core.contracts.StateAndRef> component2()

    - #### component3

          @Nullable
          public java.util.UUID component3()

    - #### component4

          @NotNull
          public net.corda.core.node.services.Vault.UpdateType component4()

      Specifies the type of update,

      currently supported types are general and, contract upgrade and notary change.Notary change transactions only modify the notary field on states, and potentially need to be handleddifferently.

    - #### component5

          @NotNull
          public java.util.Set<net.corda.core.contracts.StateAndRef> component5()

    - #### copy

          @NotNull
          public net.corda.core.node.services.Vault.Update<U> copy(@NotNull
                                                                            java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> consumed,
                                                                            @NotNull
                                                                            java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> produced,
                                                                            @Nullable
                                                                            java.util.UUID flowId,
                                                                            @NotNull
                                                                            net.corda.core.node.services.Vault.UpdateType type,
                                                                            @NotNull
                                                                            java.util.Set<? extends net.corda.core.contracts.StateAndRef<? extends U>> references)

      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.

      If the vault observes multiple transactions simultaneously, where some transactions consume the outputs of some of the other transactions observed, then the changes are observed "net" of those.

      See Also:
        `class StateRef`, `interface ContractState`

    - #### hashCode

          public int hashCode()

      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.

      If the vault observes multiple transactions simultaneously, where some transactions consume the outputs of some of the other transactions observed, then the changes are observed "net" of those.

      See Also:
        `class StateRef`, `interface ContractState`

    - #### equals

          public boolean equals(@Nullable
                                java.lang.Object p)

      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.

      If the vault observes multiple transactions simultaneously, where some transactions consume the outputs of some of the other transactions observed, then the changes are observed "net" of those.

      See Also:
        `class StateRef`, `interface ContractState`