Class ImmutableSingleSingedTransaction<T extends Transaction>

java.lang.Object
org.xrpl.xrpl4j.crypto.core.signing.ImmutableSingleSingedTransaction<T>
All Implemented Interfaces:
SignedTransaction<T>, SingleSingedTransaction<T>

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableSingleSingedTransaction<T extends Transaction> extends Object implements SingleSingedTransaction<T>
Immutable implementation of SingleSingedTransaction.

Use the builder to create immutable instances: ImmutableSingleSingedTransaction.builder().

  • Method Details

    • unsignedTransaction

      public T unsignedTransaction()
      The original transaction with no signature attached.
      Specified by:
      unsignedTransaction in interface SignedTransaction<T extends Transaction>
      Returns:
      A Transaction.
    • signedTransaction

      public T signedTransaction()
      The transaction with a signature blob attached.
      Specified by:
      signedTransaction in interface SignedTransaction<T extends Transaction>
      Returns:
      A Transaction.
    • signedTransactionBytes

      public UnsignedByteArray signedTransactionBytes()
      The signedTransaction() encoded into bytes that are suitable for submission to the XRP Ledger.
      Specified by:
      signedTransactionBytes in interface SignedTransaction<T extends Transaction>
      Returns:
      A byte-array containing the signed transaction blob.
    • signature

      public Signature signature()
      The signature and public key used to sign.
      Specified by:
      signature in interface SingleSingedTransaction<T extends Transaction>
      Returns:
      A byte-array.
    • hash

      public Hash256 hash()
      Description copied from interface: SignedTransaction
      The hash of the SignedTransaction.signedTransactionBytes() which can be used as a handle to the transaction even though the transaction hasn't yet been submitted to the XRP Ledger. This field is derived by computing the SHA512-Half of the Signed Transaction hash prefix concatenated with SignedTransaction.signedTransactionBytes().
      Specified by:
      hash in interface SignedTransaction<T extends Transaction>
      Specified by:
      hash in interface SingleSingedTransaction<T extends Transaction>
      Returns:
      The computed-at-construction value of the hash attribute
    • withUnsignedTransaction

      public final ImmutableSingleSingedTransaction<T> withUnsignedTransaction(T value)
      Copy the current immutable object by setting a value for the unsignedTransaction attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for unsignedTransaction
      Returns:
      A modified copy of the this object
    • withSignedTransaction

      public final ImmutableSingleSingedTransaction<T> withSignedTransaction(T value)
      Copy the current immutable object by setting a value for the signedTransaction attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for signedTransaction
      Returns:
      A modified copy of the this object
    • withSignedTransactionBytes

      public final ImmutableSingleSingedTransaction<T> withSignedTransactionBytes(UnsignedByteArray value)
      Copy the current immutable object by setting a value for the signedTransactionBytes attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for signedTransactionBytes
      Returns:
      A modified copy of the this object
    • withSignature

      public final ImmutableSingleSingedTransaction<T> withSignature(Signature value)
      Copy the current immutable object by setting a value for the signature attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for signature
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableSingleSingedTransaction that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: unsignedTransaction, signedTransaction, signedTransactionBytes, signature, hash.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value SingleSingedTransaction with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static <T extends Transaction> ImmutableSingleSingedTransaction<T> copyOf(SingleSingedTransaction<T> instance)
      Creates an immutable copy of a SingleSingedTransaction value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      T - generic parameter T
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable SingleSingedTransaction instance
    • builder

      public static <T extends Transaction> ImmutableSingleSingedTransaction.Builder<T> builder()
      Creates a builder for ImmutableSingleSingedTransaction.
       ImmutableSingleSingedTransaction.&lt;T&gt;builder()
          .unsignedTransaction(T) // required unsignedTransaction
          .signedTransaction(T) // required signedTransaction
          .signedTransactionBytes(org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray) // required signedTransactionBytes
          .signature(org.xrpl.xrpl4j.crypto.core.signing.Signature) // required signature
          .build();
       
      Type Parameters:
      T - generic parameter T
      Returns:
      A new ImmutableSingleSingedTransaction builder