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

net.corda.core.contracts

## Class StateRef

- net.corda.core.contracts.StateRef

-     public class StateRef

  A stateref is a pointer (reference) to a state, this is an equivalent of an "outpoint" in Bitcoin. It records which transaction defined the state and where in that transaction it was.

- - ### Constructor Detail

    - #### StateRef

          public StateRef(@NotNull
                          SecureHash txhash,
                          int index)

      A stateref is a pointer (reference) to a state, this is an equivalent of an "outpoint" in Bitcoin. It records which transaction defined the state and where in that transaction it was.

  - ### Method Detail

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### getTxhash

          @NotNull
          public SecureHash getTxhash()

    - #### getIndex

          public int getIndex()

    - #### component1

          @NotNull
          public SecureHash component1()

    - #### component2

          public int component2()

    - #### copy

          @NotNull
          public StateRef copy(@NotNull
                                        SecureHash txhash,
                                        int index)

      A stateref is a pointer (reference) to a state, this is an equivalent of an "outpoint" in Bitcoin. It records which transaction defined the state and where in that transaction it was.

    - #### hashCode

          public int hashCode()

      A stateref is a pointer (reference) to a state, this is an equivalent of an "outpoint" in Bitcoin. It records which transaction defined the state and where in that transaction it was.

    - #### equals

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

      A stateref is a pointer (reference) to a state, this is an equivalent of an "outpoint" in Bitcoin. It records which transaction defined the state and where in that transaction it was.