HashAttachmentConstraint
Keywords: net.corda.core.contracts.HashAttachmentConstraint class
Date: 2023-09-18

net.corda.core.contracts

## Class HashAttachmentConstraint

- net.corda.core.contracts.HashAttachmentConstraint

- All Implemented Interfaces:
    AttachmentConstraint

      public class HashAttachmentConstraint
      implements AttachmentConstraint

  An `interface AttachmentConstraint` that verifies by hash. The state protected by this constraint can only be used in a transaction created with that version of the jar. And a receiving node will only accept it if a cordapp with that hash has (is) been deployed on the node.

  See Also:
    `interface AttachmentConstraint`

- - ### Field Detail

    - #### Companion

          public static net.corda.core.contracts.HashAttachmentConstraint.Companion Companion

  - ### Constructor Detail

    - #### HashAttachmentConstraint

          public HashAttachmentConstraint(@NotNull
                                          SecureHash attachmentId)

      An `interface AttachmentConstraint` that verifies by hash. The state protected by this constraint can only be used in a transaction created with that version of the jar. And a receiving node will only accept it if a cordapp with that hash has (is) been deployed on the node.

      See Also:
        `interface AttachmentConstraint`

  - ### Method Detail

    - #### isSatisfiedBy

          public boolean isSatisfiedBy(@NotNull
                                       Attachment attachment)

      Returns whether the given contract attachment can be used with the `interface ContractState` associated with this constraint object.

      See Also:
        `interface ContractState`

    - #### getAttachmentId

          @NotNull
          public SecureHash getAttachmentId()

    - #### component1

          @NotNull
          public SecureHash component1()

    - #### copy

          @NotNull
          public HashAttachmentConstraint copy(@NotNull
                                                        SecureHash attachmentId)

      An `interface AttachmentConstraint` that verifies by hash. The state protected by this constraint can only be used in a transaction created with that version of the jar. And a receiving node will only accept it if a cordapp with that hash has (is) been deployed on the node.

      See Also:
        `interface AttachmentConstraint`

    - #### toString

          @NotNull
          public java.lang.String toString()

      An `interface AttachmentConstraint` that verifies by hash. The state protected by this constraint can only be used in a transaction created with that version of the jar. And a receiving node will only accept it if a cordapp with that hash has (is) been deployed on the node.

      See Also:
        `interface AttachmentConstraint`

    - #### hashCode

          public int hashCode()

      An `interface AttachmentConstraint` that verifies by hash. The state protected by this constraint can only be used in a transaction created with that version of the jar. And a receiving node will only accept it if a cordapp with that hash has (is) been deployed on the node.

      See Also:
        `interface AttachmentConstraint`

    - #### equals

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

      An `interface AttachmentConstraint` that verifies by hash. The state protected by this constraint can only be used in a transaction created with that version of the jar. And a receiving node will only accept it if a cordapp with that hash has (is) been deployed on the node.

      See Also:
        `interface AttachmentConstraint`