Class ImmutableDidObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableDidObject
All Implemented Interfaces:
DidObject, LedgerObject

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

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

  • Method Details

    • ledgerEntryType

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

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

      public Address account()
      The account that controls the DID.
      Specified by:
      account in interface DidObject
      Returns:
      An Address.
    • didDocument

      public Optional<DidDocument> didDocument()
      The W3C standard DID document associated with the DID. This field isn't checked for validity and is limited to a maximum length of 256 bytes.
      Specified by:
      didDocument in interface DidObject
      Returns:
      An optionally-present DidDocument.
    • data

      public Optional<DidData> data()
      The public attestations of identity credentials associated with the DID. This field isn't checked for validity and is limited to a maximum length of 256 bytes.
      Specified by:
      data in interface DidObject
      Returns:
      An optionally-present DidData.
    • uri

      public Optional<DidUri> uri()
      The Universal Resource Identifier that points to the corresponding DID document or the data associated with the DID. This field can be an HTTP(S) URL or IPFS URI. This field isn't checked for validity and is limited to a maximum length of 256 bytes.
      Specified by:
      uri in interface DidObject
      Returns:
      An optionally-present DidUri.
    • 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 DidObject
      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 DidObject
      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 DidObject
      Returns:
      An UnsignedInteger representing the previous transaction ledger sequence.
    • index

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

      public final ImmutableDidObject 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
    • withDidDocument

      public final ImmutableDidObject withDidDocument(DidDocument value)
      Copy the current immutable object by setting a present value for the optional didDocument attribute.
      Parameters:
      value - The value for didDocument
      Returns:
      A modified copy of this object
    • withDidDocument

      public final ImmutableDidObject withDidDocument(Optional<? extends DidDocument> optional)
      Copy the current immutable object by setting an optional value for the didDocument 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 didDocument
      Returns:
      A modified copy of this object
    • withData

      public final ImmutableDidObject withData(DidData value)
      Copy the current immutable object by setting a present value for the optional data attribute.
      Parameters:
      value - The value for data
      Returns:
      A modified copy of this object
    • withData

      public final ImmutableDidObject withData(Optional<? extends DidData> optional)
      Copy the current immutable object by setting an optional value for the data 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 data
      Returns:
      A modified copy of this object
    • withUri

      public final ImmutableDidObject withUri(DidUri value)
      Copy the current immutable object by setting a present value for the optional uri attribute.
      Parameters:
      value - The value for uri
      Returns:
      A modified copy of this object
    • withUri

      public final ImmutableDidObject withUri(Optional<? extends DidUri> optional)
      Copy the current immutable object by setting an optional value for the uri 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 uri
      Returns:
      A modified copy of this object
    • withOwnerNode

      public final ImmutableDidObject 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 ImmutableDidObject 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 ImmutableDidObject 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 ImmutableDidObject 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 ImmutableDidObject 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, flags, account, didDocument, data, uri, ownerNode, previousTransactionId, previousTransactionLedgerSequence, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableDidObject.Builder builder()
      Creates a builder for ImmutableDidObject.
       ImmutableDidObject.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .didDocument(org.xrpl.xrpl4j.model.transactions.DidDocument) // optional didDocument
          .data(org.xrpl.xrpl4j.model.transactions.DidData) // optional data
          .uri(org.xrpl.xrpl4j.model.transactions.DidUri) // optional uri
          .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 ImmutableDidObject builder