Class ImmutableBatchSigner

java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutableBatchSigner
All Implemented Interfaces:
BatchSigner

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

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

  • Method Details

    • account

      public Address account()
      The account address of the signer. This must match either the outer transaction's Account or one of the inner transaction accounts.
      Specified by:
      account in interface BatchSigner
      Returns:
      An Address.
    • transactionSignature

      public Optional<Signature> transactionSignature()
      The signature for the transaction. Present for direct signing.
      Specified by:
      transactionSignature in interface BatchSigner
      Returns:
      An optionally-present Signature.
    • signingPublicKey

      public Optional<PublicKey> signingPublicKey()
      The public key used to create the signature. Present for direct signing.
      Specified by:
      signingPublicKey in interface BatchSigner
      Returns:
      An optionally-present PublicKey.
    • sortedSigners

      public boolean sortedSigners()
      Specified by:
      sortedSigners in interface BatchSigner
      Returns:
      The value of the sortedSigners attribute
    • signers

      public com.google.common.collect.ImmutableList<SignerWrapper> signers()
      The array of signers for multi-signing (sorted). Present when using multi-sig instead of direct signing.

      Note: When building a BatchSigner, you can provide signers in any order, and they will be automatically sorted by account address for serialization and signing via the BatchSigner.checkAndNormalize() function.

      Specified by:
      signers in interface BatchSigner
      Returns:
      A List of SignerWrappers in the order they were added.
    • withAccount

      public final ImmutableBatchSigner 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 ImmutableBatchSigner withTransactionSignature(Signature value)
      Copy the current immutable object by setting a present value for the optional transactionSignature attribute.
      Parameters:
      value - The value for transactionSignature
      Returns:
      A modified copy of this object
    • withTransactionSignature

      public final ImmutableBatchSigner withTransactionSignature(Optional<? extends Signature> optional)
      Copy the current immutable object by setting an optional value for the transactionSignature attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for transactionSignature
      Returns:
      A modified copy of this object
    • withSigningPublicKey

      public final ImmutableBatchSigner withSigningPublicKey(PublicKey value)
      Copy the current immutable object by setting a present value for the optional signingPublicKey attribute.
      Parameters:
      value - The value for signingPublicKey
      Returns:
      A modified copy of this object
    • withSigningPublicKey

      public final ImmutableBatchSigner withSigningPublicKey(Optional<? extends PublicKey> optional)
      Copy the current immutable object by setting an optional value for the signingPublicKey attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for signingPublicKey
      Returns:
      A modified copy of this object
    • withSortedSigners

      public final ImmutableBatchSigner withSortedSigners(boolean value)
      Copy the current immutable object by setting a value for the sortedSigners attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sortedSigners
      Returns:
      A modified copy of the this object
    • withSigners

      public final ImmutableBatchSigner withSigners(SignerWrapper... elements)
      Copy the current immutable object with elements that replace the content of signers.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withSigners

      public final ImmutableBatchSigner withSigners(Iterable<? extends SignerWrapper> elements)
      Copy the current immutable object with elements that replace the content of signers. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of signers elements to set
      Returns:
      A modified copy of this object
    • equals

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

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

      public static ImmutableBatchSigner copyOf(BatchSigner instance)
      Creates an immutable copy of a BatchSigner 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 BatchSigner instance
    • builder

      public static ImmutableBatchSigner.Builder builder()
      Creates a builder for ImmutableBatchSigner.
       ImmutableBatchSigner.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .transactionSignature(org.xrpl.xrpl4j.crypto.signing.Signature) // optional transactionSignature
          .signingPublicKey(org.xrpl.xrpl4j.crypto.keys.PublicKey) // optional signingPublicKey
          .sortedSigners(boolean) // optional sortedSigners
          .addSigners|addAllSigners(org.xrpl.xrpl4j.model.transactions.SignerWrapper) // signers elements
          .build();
       
      Returns:
      A new ImmutableBatchSigner builder