Class ImmutableAccountRootObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableAccountRootObject
All Implemented Interfaces:
AccountRootObject, LedgerObject

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

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

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      The type of ledger object, which will always be "AccountRoot" in this case.
      Specified by:
      ledgerEntryType in interface AccountRootObject
      Returns:
      Always returns LedgerObject.LedgerEntryType.ACCOUNT_ROOT.
    • account

      public Address account()
      The unique classic Address of this account.
      Specified by:
      account in interface AccountRootObject
      Returns:
      The Address of this account.
    • balance

      public XrpCurrencyAmount balance()
      The account's current XRP balance in drops, represented as an XrpCurrencyAmount.
      Specified by:
      balance in interface AccountRootObject
      Returns:
      An XrpCurrencyAmount representing the account's XRP balance.
    • flags

      public AccountRootFlags flags()
      A bit-map of boolean AccountRootFlags enabled for this account.
      Specified by:
      flags in interface AccountRootObject
      Returns:
      An AccountRootFlags.
    • ownerCount

      public com.google.common.primitives.UnsignedInteger ownerCount()
      The number of objects this account owns in the ledger, which contributes to its owner reserve.
      Specified by:
      ownerCount in interface AccountRootObject
      Returns:
      An UnsignedInteger representing the number of objects.
    • previousTransactionId

      public Hash256 previousTransactionId()
      The identifying hash of the transaction that most recently modified this object.
      Specified by:
      previousTransactionId in interface AccountRootObject
      Returns:
      A Hash256 containing the previous transaction hash.
    • previousTransactionLedgerSequence

      public com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence()
      The index of the ledger that contains the transaction that most recently modified this object.
      Specified by:
      previousTransactionLedgerSequence in interface AccountRootObject
      Returns:
      An UnsignedInteger representing the previous transaction ledger sequence.
    • sequence

      public com.google.common.primitives.UnsignedInteger sequence()
      The sequence number of the next valid transaction for this account. (Each account starts with Sequence = 1 and increases each time a transaction is made.)
      Specified by:
      sequence in interface AccountRootObject
      Returns:
      An UnsignedInteger representing the account sequence number.
    • accountTransactionId

      public Optional<Hash256> accountTransactionId()
      The identifying hash of the transaction most recently sent by this account. This field must be enabled to use the Transaction.accountTransactionId() field. To enable it, send an AccountSet transaction with AccountSet.setFlag() equal to AccountSet.AccountSetFlag.ACCOUNT_TXN_ID.
      Specified by:
      accountTransactionId in interface AccountRootObject
      Returns:
      An Optional of type Hash256.
    • domain

      public Optional<String> domain()
      A domain associated with this account. In JSON, this is the hexadecimal for the ASCII representation of the domain.
      Specified by:
      domain in interface AccountRootObject
      Returns:
      An Optional of type String containing the domain.
    • emailHash

      public Optional<String> emailHash()
      The md5 hash of an email address. Clients can use this to look up an avatar through services such as Gravatar.
      Specified by:
      emailHash in interface AccountRootObject
      Returns:
      An Optional of type String.
    • messageKey

      public Optional<String> messageKey()
      A public key that may be used to send encrypted messages to this account. No more than 33 bytes.
      Specified by:
      messageKey in interface AccountRootObject
      Returns:
      An Optional of type String.
    • regularKey

      public Optional<Address> regularKey()
      The address of a key pair that can be used to sign Transactions for this account instead of the master key.
      Specified by:
      regularKey in interface AccountRootObject
      Returns:
      An Optional of type Address.
    • tickSize

      public Optional<com.google.common.primitives.UnsignedInteger> tickSize()
      How many significant digits to use for exchange rates of Offers involving currencies issued by this address. Valid values are 3 to 15, inclusive.
      Specified by:
      tickSize in interface AccountRootObject
      Returns:
      An Optional of type UnsignedInteger.
    • transferRate

      public Optional<com.google.common.primitives.UnsignedInteger> transferRate()
      A transfer fee to charge other users for sending currency issued by this account to each other.
      Specified by:
      transferRate in interface AccountRootObject
      Returns:
      An Optional of type UnsignedInteger.
    • signerLists

      public com.google.common.collect.ImmutableList<SignerListObject> signerLists()
      (Omitted unless the request specified signer_lists and at least one SignerList is associated with the account.) Array of SignerListObject ledger objects associated with this account for Multi-Signing. Since an account can own at most one SignerList, this array must have exactly one member if it is present.
      Specified by:
      signerLists in interface AccountRootObject
      Returns:
      A List of SignerListObjects.
    • ticketCount

      public Optional<com.google.common.primitives.UnsignedInteger> ticketCount()
      How many Tickets this account owns in the ledger. This is updated automatically to ensure that the account stays within the hard limit of 250 Tickets at a time. This field is omitted if the account has zero Tickets.
      Specified by:
      ticketCount in interface AccountRootObject
      Returns:
      An optionally-present UnsignedInteger representing the number of tickets this account owns.
    • burnedNfTokens

      public Optional<com.google.common.primitives.UnsignedInteger> burnedNfTokens()
      How many total of this account's issued non-fungible tokens have been burned. This number is always equal or less than mintedNfTokens.
      Specified by:
      burnedNfTokens in interface AccountRootObject
      Returns:
      An optionally-present UnsignedInteger representing the number of NFTs this account has burned.
    • mintedNfTokens

      public Optional<com.google.common.primitives.UnsignedInteger> mintedNfTokens()
      How many total non-fungible tokens have been minted by and on behalf of this account.
      Specified by:
      mintedNfTokens in interface AccountRootObject
      Returns:
      An optionally-present UnsignedInteger representing the number of NFTs this account has minted.
    • nfTokenMinter

      public Optional<Address> nfTokenMinter()
      Another account that can mint non-fungible tokens on behalf of this account.
      Specified by:
      nfTokenMinter in interface AccountRootObject
      Returns:
      The optionally-present Address of the account that can mint NFTs on behalf of this account.
    • ammId

      public Optional<Hash256> ammId()
      The ledger entry ID of the corresponding AMM ledger entry. Set during account creation; cannot be modified. If present, indicates that this is a special AMM AccountRoot; always omitted on non-AMM accounts.

      This method will be marked Beta until the AMM amendment is enabled on mainnet. Its API is subject to change.

      Specified by:
      ammId in interface AccountRootObject
      Returns:
      An optionally-present Hash256.
    • walletLocator

      public Optional<String> walletLocator()
      An arbitrary 256-bit value that users can set.
      Specified by:
      walletLocator in interface AccountRootObject
      Returns:
      An Optional String.
    • index

      public Hash256 index()
      The unique ID of this AccountRootObject ledger object.
      Specified by:
      index in interface AccountRootObject
      Returns:
      A Hash256.
      See Also:
      • "https://xrpl.org/ledger-object-ids.html"
    • withAccount

      public final ImmutableAccountRootObject 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
    • withBalance

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

      public final ImmutableAccountRootObject withFlags(AccountRootFlags value)
      Copy the current immutable object by setting a value for the flags attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for flags
      Returns:
      A modified copy of the this object
    • withOwnerCount

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

      public final ImmutableAccountRootObject withPreviousTransactionId(Hash256 value)
      Copy the current immutable object by setting a value for the previousTransactionId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionId
      Returns:
      A modified copy of the this object
    • withPreviousTransactionLedgerSequence

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

      public final ImmutableAccountRootObject 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
    • withAccountTransactionId

      public final ImmutableAccountRootObject 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 ImmutableAccountRootObject 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
    • withDomain

      public final ImmutableAccountRootObject withDomain(String value)
      Copy the current immutable object by setting a present value for the optional domain attribute.
      Parameters:
      value - The value for domain
      Returns:
      A modified copy of this object
    • withDomain

      public final ImmutableAccountRootObject withDomain(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the domain 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 domain
      Returns:
      A modified copy of this object
    • withEmailHash

      public final ImmutableAccountRootObject withEmailHash(String value)
      Copy the current immutable object by setting a present value for the optional emailHash attribute.
      Parameters:
      value - The value for emailHash
      Returns:
      A modified copy of this object
    • withEmailHash

      public final ImmutableAccountRootObject withEmailHash(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the emailHash 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 emailHash
      Returns:
      A modified copy of this object
    • withMessageKey

      public final ImmutableAccountRootObject withMessageKey(String value)
      Copy the current immutable object by setting a present value for the optional messageKey attribute.
      Parameters:
      value - The value for messageKey
      Returns:
      A modified copy of this object
    • withMessageKey

      public final ImmutableAccountRootObject withMessageKey(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the messageKey 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 messageKey
      Returns:
      A modified copy of this object
    • withRegularKey

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

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

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

      public final ImmutableAccountRootObject withTickSize(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the tickSize 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 tickSize
      Returns:
      A modified copy of this object
    • withTransferRate

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

      public final ImmutableAccountRootObject withTransferRate(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the transferRate 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 transferRate
      Returns:
      A modified copy of this object
    • withSignerLists

      public final ImmutableAccountRootObject withSignerLists(SignerListObject... elements)
      Copy the current immutable object with elements that replace the content of signerLists.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withSignerLists

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

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

      public final ImmutableAccountRootObject withTicketCount(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the ticketCount 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 ticketCount
      Returns:
      A modified copy of this object
    • withBurnedNfTokens

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

      public final ImmutableAccountRootObject withBurnedNfTokens(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the burnedNfTokens 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 burnedNfTokens
      Returns:
      A modified copy of this object
    • withMintedNfTokens

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

      public final ImmutableAccountRootObject withMintedNfTokens(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the mintedNfTokens 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 mintedNfTokens
      Returns:
      A modified copy of this object
    • withNfTokenMinter

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

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

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

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

      public final ImmutableAccountRootObject withWalletLocator(String value)
      Copy the current immutable object by setting a present value for the optional walletLocator attribute.
      Parameters:
      value - The value for walletLocator
      Returns:
      A modified copy of this object
    • withWalletLocator

      public final ImmutableAccountRootObject withWalletLocator(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the walletLocator 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 walletLocator
      Returns:
      A modified copy of this object
    • withIndex

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableAccountRootObject 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: ledgerEntryType, account, balance, flags, ownerCount, previousTransactionId, previousTransactionLedgerSequence, sequence, accountTransactionId, domain, emailHash, messageKey, regularKey, tickSize, transferRate, signerLists, ticketCount, burnedNfTokens, mintedNfTokens, nfTokenMinter, ammId, walletLocator, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableAccountRootObject.Builder builder()
      Creates a builder for ImmutableAccountRootObject.
       ImmutableAccountRootObject.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .balance(org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount) // required balance
          .flags(org.xrpl.xrpl4j.model.flags.AccountRootFlags) // required flags
          .ownerCount(com.google.common.primitives.UnsignedInteger) // required ownerCount
          .previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTransactionId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .sequence(com.google.common.primitives.UnsignedInteger) // required sequence
          .accountTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // optional accountTransactionId
          .domain(String) // optional domain
          .emailHash(String) // optional emailHash
          .messageKey(String) // optional messageKey
          .regularKey(org.xrpl.xrpl4j.model.transactions.Address) // optional regularKey
          .tickSize(com.google.common.primitives.UnsignedInteger) // optional tickSize
          .transferRate(com.google.common.primitives.UnsignedInteger) // optional transferRate
          .addSignerLists|addAllSignerLists(org.xrpl.xrpl4j.model.ledger.SignerListObject) // signerLists elements
          .ticketCount(com.google.common.primitives.UnsignedInteger) // optional ticketCount
          .burnedNfTokens(com.google.common.primitives.UnsignedInteger) // optional burnedNfTokens
          .mintedNfTokens(com.google.common.primitives.UnsignedInteger) // optional mintedNfTokens
          .nfTokenMinter(org.xrpl.xrpl4j.model.transactions.Address) // optional nfTokenMinter
          .ammId(org.xrpl.xrpl4j.model.transactions.Hash256) // optional ammId
          .walletLocator(String) // optional walletLocator
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableAccountRootObject builder