Class ImmutableDelegateObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableDelegateObject
All Implemented Interfaces:
DelegateObject, LedgerObject

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

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

  • Method Details

    • ledgerEntryType

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

      public Address account()
      The account that wants to authorize another account.
      Specified by:
      account in interface DelegateObject
      Returns:
      The Address of the account.
    • authorize

      public Address authorize()
      The authorized account.
      Specified by:
      authorize in interface DelegateObject
      Returns:
      The Address of the authorized account.
    • permissions

      public com.google.common.collect.ImmutableList<PermissionWrapper> permissions()
      The transaction permissions that the account has access to.
      Specified by:
      permissions in interface DelegateObject
      Returns:
      A List of PermissionWrappers.
    • 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 DelegateObject
      Returns:
      A String containing the owner node hint.
    • flags

      public Flags flags()
      A bit-map of boolean flags. No flags are defined for the Delegate object type, so this value is always 0.
      Specified by:
      flags in interface DelegateObject
      Returns:
      Always Flags.UNSET.
    • previousTransactionId

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

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

      public final ImmutableDelegateObject 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 ImmutableDelegateObject withAuthorize(Address value)
      Copy the current immutable object by setting a value for the authorize attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for authorize
      Returns:
      A modified copy of the this object
    • withPermissions

      public final ImmutableDelegateObject withPermissions(PermissionWrapper... elements)
      Copy the current immutable object with elements that replace the content of permissions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withPermissions

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

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

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

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

      public static ImmutableDelegateObject.Builder builder()
      Creates a builder for ImmutableDelegateObject.
       ImmutableDelegateObject.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .authorize(org.xrpl.xrpl4j.model.transactions.Address) // required authorize
          .addPermissions|addAllPermissions(org.xrpl.xrpl4j.model.transactions.PermissionWrapper) // permissions 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 ImmutableDelegateObject builder