net.corda.core.transactions

## Class BaseTransaction

- net.corda.core.transactions.BaseTransaction

- All Implemented Interfaces:
    NamedByHash
  Direct Known Subclasses:
    LedgerTransaction, WireTransaction

      public class BaseTransaction
      implements NamedByHash

  An abstract class defining fields shared by all transaction types in the system.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseTransaction(java.util.List<?> inputs, java.util.List<? extends net.corda.core.contracts.TransactionState<? extends net.corda.core.contracts.ContractState>> outputs, Party notary, java.util.List<? extends net.corda.core.crypto.CompositeKey> mustSign, TransactionType type, Timestamp timestamp)` An abstract class defining fields shared by all transaction types in the system.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkInvariants()`
    `boolean` | `equals(java.lang.Object other)`
    `java.util.List<?>` | `getInputs()` The inputs of this transaction.
    `java.util.List<net.corda.core.crypto.CompositeKey>` | `getMustSign()` Composite keys that need to be fulfilled by signatures in order for the transaction to be valid. In a `class SignedTransaction` this list is used to check whether there are any missing signatures. Note that there is nothing that forces the list to be the correct list of signers for this transaction until the transaction is verified by using `LedgerTransaction.verify`.
    `Party` | `getNotary()` If present,
    `java.util.List<net.corda.core.contracts.TransactionState>` | `getOutputs()` Ordered list of states defined by this transaction,
    `Timestamp` | `getTimestamp()` If specified,
    `TransactionType` | `getType()` Pointer to a class that defines the behaviour of this transaction
    `int` | `hashCode()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from interface net.corda.core.contracts.NamedByHash

      `getId`

- - ### Constructor Detail

    - #### BaseTransaction

          public BaseTransaction(java.util.List<?> inputs,
                                 java.util.List<? extends net.corda.core.contracts.TransactionState<? extends net.corda.core.contracts.ContractState>> outputs,
                                 Party notary,
                                 java.util.List<? extends net.corda.core.crypto.CompositeKey> mustSign,
                                 TransactionType type,
                                 Timestamp timestamp)

      An abstract class defining fields shared by all transaction types in the system.

      Parameters:
        `inputs` - The inputs of this transaction.Note that in BaseTransaction subclasses the type of this list may change!
        `outputs` - Ordered list of states defined by this transaction,along with the associated notaries.
        `notary` - If present,the notary for this transaction.If absent then the transaction is not notarised at all.This is intended for issuance/genesis transactions that don't consume any other states and thus can'tdouble spend anything.
        `mustSign` -

        Composite keys that need to be fulfilled by signatures in order for the transaction to be valid. In a `class SignedTransaction` this list is used to check whether there are any missing signatures. Note that there is nothing that forces the list to be the correct list of signers for this transaction until the transaction is verified by using `LedgerTransaction.verify`.

        It includes the notary key, if the notary field is set.

        `type` - Pointer to a class that defines the behaviour of this transaction:either normal,or"notary changing".
        `timestamp` - If specified,a time window in which this transaction may have been notarised.Contracts can check thistime window to find out when a transaction is deemed to have occurred,from the ledger's perspective.

  - ### Method Detail

    - #### checkInvariants

          public void checkInvariants()

    - #### equals

          public boolean equals(java.lang.Object other)

    - #### hashCode

          public int hashCode()

    - #### toString

          public java.lang.String toString()

    - #### getInputs

          public java.util.List<?> getInputs()

      The inputs of this transaction.

      Note that in BaseTransaction subclasses the type of this list may change!

    - #### getOutputs

          public java.util.List<net.corda.core.contracts.TransactionState> getOutputs()

      Ordered list of states defined by this transaction,

      along with the associated notaries.

    - #### getNotary

          public Party getNotary()

      If present,

      the notary for this transaction.If absent then the transaction is not notarised at all.This is intended for issuance/genesis transactions that don't consume any other states and thus can'tdouble spend anything.

    - #### getMustSign

          public java.util.List<net.corda.core.crypto.CompositeKey> getMustSign()

      Composite keys that need to be fulfilled by signatures in order for the transaction to be valid. In a `class SignedTransaction` this list is used to check whether there are any missing signatures. Note that there is nothing that forces the list to be the correct list of signers for this transaction until the transaction is verified by using `LedgerTransaction.verify`.

      It includes the notary key, if the notary field is set.

      See Also:
        `class SignedTransaction`, `LedgerTransaction.verify`

    - #### getType

          public TransactionType getType()

      Pointer to a class that defines the behaviour of this transaction

      :either normal,or"notary changing".

    - #### getTimestamp

          public Timestamp getTimestamp()

      If specified,

      a time window in which this transaction may have been notarised.Contracts can check thistime window to find out when a transaction is deemed to have occurred,from the ledger's perspective.