Class ImmutableSigner

java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutableSigner
All Implemented Interfaces:
Signer

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableSigner extends Object implements Signer
Immutable implementation of Signer.

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

  • Method Details

    • account

      public Address account()
      The Address associated with this signature, as it appears in the signer list.

      Note that in general, this address is derived from the Signer.signingPublicKey(), but in the case of an account that has set a different regular key, this value may diverge from the public key. Therefore, we use the `@Default` annotation here to ensure that this value is derived from the public key if not explicitly set.

      Specified by:
      account in interface Signer
      Returns:
      The Address of the signer account.
    • transactionSignature

      public Signature transactionSignature()
      A signature for a transaction, verifiable using the Signer.signingPublicKey().
      Specified by:
      transactionSignature in interface Signer
      Returns:
      A String containing the transaction signature.
    • signingPublicKey

      public PublicKey signingPublicKey()
      The public key used to create this signature.
      Specified by:
      signingPublicKey in interface Signer
      Returns:
      A String containing the public key used to sign the transaction.
    • withAccount

      public final ImmutableSigner withAccount(Address value)
      Copy the current immutable object by setting a value for the account attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for account
      Returns:
      A modified copy of the this object
    • withTransactionSignature

      public final ImmutableSigner withTransactionSignature(Signature value)
      Copy the current immutable object by setting a value for the transactionSignature attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for transactionSignature
      Returns:
      A modified copy of the this object
    • withSigningPublicKey

      public final ImmutableSigner withSigningPublicKey(PublicKey value)
      Copy the current immutable object by setting a value for the signingPublicKey attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for signingPublicKey
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableSigner 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: account, transactionSignature, signingPublicKey.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableSigner copyOf(Signer instance)
      Creates an immutable copy of a Signer value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable Signer instance
    • builder

      public static ImmutableSigner.Builder builder()
      Creates a builder for ImmutableSigner.
       ImmutableSigner.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // optional account
          .transactionSignature(org.xrpl.xrpl4j.crypto.signing.Signature) // required transactionSignature
          .signingPublicKey(org.xrpl.xrpl4j.crypto.keys.PublicKey) // required signingPublicKey
          .build();
       
      Returns:
      A new ImmutableSigner builder