Class ImmutableSetFee

java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutableSetFee
All Implemented Interfaces:
SetFee, Transaction

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

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

  • Method Details

    • account

      public Address account()
      The unique Address of the account that initiated this transaction.
      Specified by:
      account in interface Transaction
      Returns:
      The Address of the account submitting this transaction.
    • transactionType

      public TransactionType transactionType()
      The type of transaction.
      Specified by:
      transactionType in interface Transaction
      Returns:
      A TransactionType.
    • fee

      public XrpCurrencyAmount fee()
      The String representation of an integer amount of XRP, in drops, to be destroyed as a cost for distributing this Payment transaction to the network.

      This field is auto-fillable

      Specified by:
      fee in interface Transaction
      Returns:
      An XrpCurrencyAmount representing the transaction cost.
      See Also:
      • "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields"
    • sequence

      public com.google.common.primitives.UnsignedInteger sequence()
      The sequence number of the account submitting the Transaction. A Transaction is only valid if the Sequence number is exactly 1 greater than the previous transaction from the same account.

      This field is auto-fillable

      Specified by:
      sequence in interface Transaction
      Returns:
      An UnsignedInteger representing the sequence of the transaction.
      See Also:
      • "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields"
    • ticketSequence

      public Optional<com.google.common.primitives.UnsignedInteger> ticketSequence()
      The sequence number of the TicketObject to use in place of a sequence() number. If this is provided, sequence() must be 0. Cannot be used with accountTransactionId().
      Specified by:
      ticketSequence in interface Transaction
      Returns:
      An UnsignedInteger representing the ticket sequence of the transaction.
    • accountTransactionId

      public Optional<Hash256> accountTransactionId()
      Hash value identifying another transaction. If provided, this Transaction is only valid if the sending account's previously-sent transaction matches the provided hash.
      Specified by:
      accountTransactionId in interface Transaction
      Returns:
      An Optional of type Hash256 containing the account transaction ID.
    • lastLedgerSequence

      public Optional<com.google.common.primitives.UnsignedInteger> lastLedgerSequence()
      Highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected.
      Specified by:
      lastLedgerSequence in interface Transaction
      Returns:
      An Optional of type UnsignedInteger representing the last ledger sequence.
    • memos

      public com.google.common.collect.ImmutableList<MemoWrapper> memos()
      Additional arbitrary information used to identify this Transaction.
      Specified by:
      memos in interface Transaction
      Returns:
      A List of MemoWrappers.
    • signers

      public com.google.common.collect.ImmutableList<SignerWrapper> signers()
      Array of SignerWrappers that represent a multi-signature which authorizes this Transaction.
      Specified by:
      signers in interface Transaction
      Returns:
      A List of SignerWrappers.
    • sourceTag

      public Optional<com.google.common.primitives.UnsignedInteger> sourceTag()
      Arbitrary UnsignedInteger used to identify the reason for this Transaction, or a sender on whose behalf this Transaction is made.
      Specified by:
      sourceTag in interface Transaction
      Returns:
      An Optional UnsignedInteger representing the source account's tag.
    • signingPublicKey

      public PublicKey signingPublicKey()
      The PublicKey that corresponds to the private key used to sign this transaction. If an empty string, ie PublicKey.MULTI_SIGN_PUBLIC_KEY, indicates a multi-signature is present in the Transaction.signers() field instead.
      Specified by:
      signingPublicKey in interface Transaction
      Returns:
      A PublicKey containing the public key of the account submitting the transaction, or PublicKey.MULTI_SIGN_PUBLIC_KEY if the transaction is multi-signed.
    • transactionSignature

      public Optional<Signature> transactionSignature()
      The signature that verifies this transaction as originating from the account it says it is from.

      This field is automatically added when signing this Transaction.

      Specified by:
      transactionSignature in interface Transaction
      Returns:
      An Optional String containing the transaction signature.
    • networkId

      public Optional<NetworkId> networkId()
      Specified by:
      networkId in interface Transaction
      Returns:
      The value of the networkId attribute
    • delegate

      public Optional<Address> delegate()
      The delegate account that is sending the transaction on behalf of the account().

      The way the Delegate field works is somewhat akin to RegularKey. The account() field is the delegating account, the Delegate field is the delegate, and the signingPublicKey() and transactionSignature() are based on the delegate's keys.

      If a Delegate has multisign enabled, they can also use that multisign setup on their delegated transactions.

      The delegate will pay the fees on the transaction, to prevent a delegate from draining an account's XRP via fees. Only the account()'s sequence number is incremented, not the Delegate's.

      This field is part of the Permission Delegation feature (XLS-75).

      Specified by:
      delegate in interface Transaction
      Returns:
      An Optional Address of the delegate account.
      See Also:
      • "https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0075-permission-delegation"
    • unknownFields

      public com.google.common.collect.ImmutableMap<String,Object> unknownFields()
      Specified by:
      unknownFields in interface Transaction
      Returns:
      The value of the unknownFields attribute
    • baseFee

      public String baseFee()
      The charge, in drops of XRP, for the reference transaction, as hex. (This is the transaction cost before scaling for load.)

      This method only exists for historical purposes. When deserialized from a SetFee transaction from ledgers prior to the XRPFees amendment, this field will still be set based on baseFeeDrops().

      Specified by:
      baseFee in interface SetFee
      Returns:
      A hex String baseFee value.
    • baseFeeDrops

      public XrpCurrencyAmount baseFeeDrops()
      The charge, in drops of XRP, for the reference transaction (This is the transaction cost before scaling for load).

      This field will also be populated with the BaseFee value from any SetFee transactions that occurred before the XRPFees amendment took effect.

      Specified by:
      baseFeeDrops in interface SetFee
      Returns:
      An XrpCurrencyAmount.
    • referenceFeeUnits

      public Optional<com.google.common.primitives.UnsignedInteger> referenceFeeUnits()
      The cost, in fee units, of the reference transaction. SetFee transactions deserialized from ledgers prior to the XRPFees amendment will always have this field, but transactions deserialized from ledgers post XRPFees activation will never have this field.
      Specified by:
      referenceFeeUnits in interface SetFee
      Returns:
      An UnsignedInteger cost of ref transaction.
    • reserveBase

      public com.google.common.primitives.UnsignedInteger reserveBase()
      The base reserve, in drops.

      This method only exists for historical purposes. When deserialized from a SetFee transaction from ledgers prior to the XRPFees amendment, this field will still be set based on reserveBaseDrops()}.

      Specified by:
      reserveBase in interface SetFee
      Returns:
      An UnsignedInteger base reserve value in FeeDrops.
    • reserveBaseDrops

      public XrpCurrencyAmount reserveBaseDrops()
      The base reserve, as an XrpCurrencyAmount.

      This field will also be populated with the ReserveBase value from any SetFee transactions that occurred before the XRPFees amendment took effect.

      Specified by:
      reserveBaseDrops in interface SetFee
      Returns:
      An XrpCurrencyAmount.
    • reserveIncrement

      public com.google.common.primitives.UnsignedInteger reserveIncrement()
      The incremental reserve, in drops.

      This method only exists for historical purposes. When deserialized from a SetFee transaction from ledgers prior to the XRPFees amendment, this field will still be set based on reserveIncrementDrops().

      Specified by:
      reserveIncrement in interface SetFee
      Returns:
      An UnsignedInteger incremental reserve in FeeDrops.
    • reserveIncrementDrops

      public XrpCurrencyAmount reserveIncrementDrops()
      The incremental reserve, as an XrpCurrencyAmount.

      This field will also be populated with the ReserveIncrement value from any SetFee transactions that occurred before the XRPFees amendment took effect.

      Specified by:
      reserveIncrementDrops in interface SetFee
      Returns:
      An XrpCurrencyAmount.
    • ledgerSequence

      public Optional<LedgerIndex> ledgerSequence()
      The index of the ledger version where this pseudo-transaction appears. This distinguishes the pseudo-transaction from other occurrences of the same change. Omitted for some historical SetFee pseudo-transactions hence making it optional.
      Specified by:
      ledgerSequence in interface SetFee
      Returns:
      A LedgerIndex to indicates where the tx appears.
    • withAccount

      public final ImmutableSetFee 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
    • withTransactionType

      public final ImmutableSetFee withTransactionType(TransactionType value)
      Copy the current immutable object by setting a value for the transactionType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for transactionType
      Returns:
      A modified copy of the this object
    • withFee

      public final ImmutableSetFee withFee(XrpCurrencyAmount value)
      Copy the current immutable object by setting a value for the fee attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for fee
      Returns:
      A modified copy of the this object
    • withSequence

      public final ImmutableSetFee withSequence(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a value for the sequence attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sequence
      Returns:
      A modified copy of the this object
    • withTicketSequence

      public final ImmutableSetFee withTicketSequence(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional ticketSequence attribute.
      Parameters:
      value - The value for ticketSequence
      Returns:
      A modified copy of this object
    • withTicketSequence

      public final ImmutableSetFee withTicketSequence(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the ticketSequence attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for ticketSequence
      Returns:
      A modified copy of this object
    • withAccountTransactionId

      public final ImmutableSetFee withAccountTransactionId(Hash256 value)
      Copy the current immutable object by setting a present value for the optional accountTransactionId attribute.
      Parameters:
      value - The value for accountTransactionId
      Returns:
      A modified copy of this object
    • withAccountTransactionId

      public final ImmutableSetFee withAccountTransactionId(Optional<? extends Hash256> optional)
      Copy the current immutable object by setting an optional value for the accountTransactionId 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 accountTransactionId
      Returns:
      A modified copy of this object
    • withLastLedgerSequence

      public final ImmutableSetFee withLastLedgerSequence(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional lastLedgerSequence attribute.
      Parameters:
      value - The value for lastLedgerSequence
      Returns:
      A modified copy of this object
    • withLastLedgerSequence

      public final ImmutableSetFee withLastLedgerSequence(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the lastLedgerSequence attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for lastLedgerSequence
      Returns:
      A modified copy of this object
    • withMemos

      public final ImmutableSetFee withMemos(MemoWrapper... elements)
      Copy the current immutable object with elements that replace the content of memos.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMemos

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

      public final ImmutableSetFee 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 ImmutableSetFee 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
    • withSourceTag

      public final ImmutableSetFee withSourceTag(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional sourceTag attribute.
      Parameters:
      value - The value for sourceTag
      Returns:
      A modified copy of this object
    • withSourceTag

      public final ImmutableSetFee withSourceTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the sourceTag attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for sourceTag
      Returns:
      A modified copy of this object
    • withSigningPublicKey

      public final ImmutableSetFee 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
    • withTransactionSignature

      public final ImmutableSetFee 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 ImmutableSetFee 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
    • withNetworkId

      public final ImmutableSetFee withNetworkId(NetworkId value)
      Copy the current immutable object by setting a present value for the optional networkId attribute.
      Parameters:
      value - The value for networkId
      Returns:
      A modified copy of this object
    • withNetworkId

      public final ImmutableSetFee withNetworkId(Optional<? extends NetworkId> optional)
      Copy the current immutable object by setting an optional value for the networkId 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 networkId
      Returns:
      A modified copy of this object
    • withDelegate

      public final ImmutableSetFee withDelegate(Address value)
      Copy the current immutable object by setting a present value for the optional delegate attribute.
      Parameters:
      value - The value for delegate
      Returns:
      A modified copy of this object
    • withDelegate

      public final ImmutableSetFee withDelegate(Optional<? extends Address> optional)
      Copy the current immutable object by setting an optional value for the delegate 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 delegate
      Returns:
      A modified copy of this object
    • withUnknownFields

      public final ImmutableSetFee withUnknownFields(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the unknownFields map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the unknownFields map
      Returns:
      A modified copy of this object
    • withBaseFeeDrops

      public final ImmutableSetFee withBaseFeeDrops(XrpCurrencyAmount value)
      Copy the current immutable object by setting a value for the baseFeeDrops attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for baseFeeDrops
      Returns:
      A modified copy of the this object
    • withReferenceFeeUnits

      public final ImmutableSetFee withReferenceFeeUnits(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional referenceFeeUnits attribute.
      Parameters:
      value - The value for referenceFeeUnits
      Returns:
      A modified copy of this object
    • withReferenceFeeUnits

      public final ImmutableSetFee withReferenceFeeUnits(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the referenceFeeUnits attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for referenceFeeUnits
      Returns:
      A modified copy of this object
    • withReserveBaseDrops

      public final ImmutableSetFee withReserveBaseDrops(XrpCurrencyAmount value)
      Copy the current immutable object by setting a value for the reserveBaseDrops attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for reserveBaseDrops
      Returns:
      A modified copy of the this object
    • withReserveIncrementDrops

      public final ImmutableSetFee withReserveIncrementDrops(XrpCurrencyAmount value)
      Copy the current immutable object by setting a value for the reserveIncrementDrops attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for reserveIncrementDrops
      Returns:
      A modified copy of the this object
    • withLedgerSequence

      public final ImmutableSetFee withLedgerSequence(LedgerIndex value)
      Copy the current immutable object by setting a present value for the optional ledgerSequence attribute.
      Parameters:
      value - The value for ledgerSequence
      Returns:
      A modified copy of this object
    • withLedgerSequence

      public final ImmutableSetFee withLedgerSequence(Optional<? extends LedgerIndex> optional)
      Copy the current immutable object by setting an optional value for the ledgerSequence 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 ledgerSequence
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableSetFee 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, transactionType, fee, sequence, ticketSequence, accountTransactionId, lastLedgerSequence, memos, signers, sourceTag, signingPublicKey, transactionSignature, networkId, delegate, unknownFields, baseFee, baseFeeDrops, referenceFeeUnits, reserveBase, reserveBaseDrops, reserveIncrement, reserveIncrementDrops, ledgerSequence.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableSetFee.Builder builder()
      Creates a builder for ImmutableSetFee.
       ImmutableSetFee.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .transactionType(org.xrpl.xrpl4j.model.transactions.TransactionType) // optional transactionType
          .fee(org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount) // required fee
          .sequence(com.google.common.primitives.UnsignedInteger) // optional sequence
          .ticketSequence(com.google.common.primitives.UnsignedInteger) // optional ticketSequence
          .accountTransactionId(Hash256) // optional accountTransactionId
          .lastLedgerSequence(com.google.common.primitives.UnsignedInteger) // optional lastLedgerSequence
          .addMemos|addAllMemos(org.xrpl.xrpl4j.model.transactions.MemoWrapper) // memos elements
          .addSigners|addAllSigners(org.xrpl.xrpl4j.model.transactions.SignerWrapper) // signers elements
          .sourceTag(com.google.common.primitives.UnsignedInteger) // optional sourceTag
          .signingPublicKey(org.xrpl.xrpl4j.crypto.keys.PublicKey) // optional signingPublicKey
          .transactionSignature(org.xrpl.xrpl4j.crypto.signing.Signature) // optional transactionSignature
          .networkId(NetworkId) // optional networkId
          .delegate(Address) // optional delegate
          .putUnknownFields|putAllUnknownFields(String => Object) // unknownFields mappings
          .baseFeeDrops(org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount) // required baseFeeDrops
          .referenceFeeUnits(com.google.common.primitives.UnsignedInteger) // optional referenceFeeUnits
          .reserveBaseDrops(org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount) // required reserveBaseDrops
          .reserveIncrementDrops(org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount) // required reserveIncrementDrops
          .ledgerSequence(org.xrpl.xrpl4j.model.client.common.LedgerIndex) // optional ledgerSequence
          .build();
       
      Returns:
      A new ImmutableSetFee builder