Class ImmutableDepositPreAuthObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableDepositPreAuthObject
All Implemented Interfaces:
DepositPreAuthObject, LedgerObject

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

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

  • Method Details

    • ledgerEntryType

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

      public Address account()
      The account that granted the preauthorization. (The destination of the preauthorized payments.)
      Specified by:
      account in interface DepositPreAuthObject
      Returns:
      The Address of the account.
    • authorize

      public Optional<Address> authorize()
      The account that received the preauthorization. (The sender of the preauthorized payments.)
      Specified by:
      authorize in interface DepositPreAuthObject
      Returns:
      The Address of the account to authorize.
    • authorizeCredentials

      public com.google.common.collect.ImmutableList<CredentialWrapper> authorizeCredentials()
      The credential(s) that received the preauthorization.
      Specified by:
      authorizeCredentials in interface DepositPreAuthObject
      Returns:
      A list of CredentialWrapper.
    • flags

      public Flags flags()
      A bit-map of boolean flags. No flags are defined for DepositPreAuthObjects, so this value is always 0.
      Specified by:
      flags in interface DepositPreAuthObject
      Returns:
      Always Flags.UNSET.
    • ownerNode

      public String ownerNode()
      A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages.

      Note: The object does not contain a direct link to the owner directory containing it, since that value can be derived from the Account.

      Specified by:
      ownerNode in interface DepositPreAuthObject
      Returns:
      A String containing the owner node hint.
    • previousTransactionId

      public Hash256 previousTransactionId()
      The identifying hash of the transaction that most recently modified this object.
      Specified by:
      previousTransactionId in interface DepositPreAuthObject
      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 DepositPreAuthObject
      Returns:
      An UnsignedInteger representing the previous transaction ledger sequence.
    • index

      public Hash256 index()
      The unique ID of the DepositPreAuthObject.
      Specified by:
      index in interface DepositPreAuthObject
      Returns:
      A Hash256 containing the ID.
    • withAccount

      public final ImmutableDepositPreAuthObject 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
    • withAuthorize

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

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

      public final ImmutableDepositPreAuthObject withAuthorizeCredentials(CredentialWrapper... elements)
      Copy the current immutable object with elements that replace the content of authorizeCredentials.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAuthorizeCredentials

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

      public final ImmutableDepositPreAuthObject withOwnerNode(String value)
      Copy the current immutable object by setting a value for the ownerNode attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ownerNode
      Returns:
      A modified copy of the this object
    • withPreviousTransactionId

      public final ImmutableDepositPreAuthObject 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 ImmutableDepositPreAuthObject 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
    • withIndex

      public final ImmutableDepositPreAuthObject 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 ImmutableDepositPreAuthObject 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, authorize, authorizeCredentials, flags, ownerNode, previousTransactionId, previousTransactionLedgerSequence, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableDepositPreAuthObject.Builder builder()
      Creates a builder for ImmutableDepositPreAuthObject.
       ImmutableDepositPreAuthObject.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .authorize(org.xrpl.xrpl4j.model.transactions.Address) // optional authorize
          .addAuthorizeCredentials|addAllAuthorizeCredentials(org.xrpl.xrpl4j.model.transactions.CredentialWrapper) // authorizeCredentials elements
          .ownerNode(String) // required ownerNode
          .previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTransactionId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableDepositPreAuthObject builder