Class ImmutableDidObject.Builder

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableDidObject.Builder
Enclosing class:
ImmutableDidObject

@NotThreadSafe public static final class ImmutableDidObject.Builder extends Object
Builds instances of type ImmutableDidObject. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder from(DidObject instance)
      Fill a builder with attribute values from the provided DidObject instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • account

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder account(Address account)
      Initializes the value for the account attribute.
      Parameters:
      account - The value for account
      Returns:
      this builder for use in a chained invocation
    • didDocument

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder didDocument(DidDocument didDocument)
      Initializes the optional value didDocument to didDocument.
      Parameters:
      didDocument - The value for didDocument
      Returns:
      this builder for chained invocation
    • didDocument

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder didDocument(Optional<? extends DidDocument> didDocument)
      Initializes the optional value didDocument to didDocument.
      Parameters:
      didDocument - The value for didDocument
      Returns:
      this builder for use in a chained invocation
    • data

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder data(DidData data)
      Initializes the optional value data to data.
      Parameters:
      data - The value for data
      Returns:
      this builder for chained invocation
    • data

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder data(Optional<? extends DidData> data)
      Initializes the optional value data to data.
      Parameters:
      data - The value for data
      Returns:
      this builder for use in a chained invocation
    • uri

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder uri(DidUri uri)
      Initializes the optional value uri to uri.
      Parameters:
      uri - The value for uri
      Returns:
      this builder for chained invocation
    • uri

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder uri(Optional<? extends DidUri> uri)
      Initializes the optional value uri to uri.
      Parameters:
      uri - The value for uri
      Returns:
      this builder for use in a chained invocation
    • ownerNode

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder ownerNode(String ownerNode)
      Initializes the value for the ownerNode attribute.
      Parameters:
      ownerNode - The value for ownerNode
      Returns:
      this builder for use in a chained invocation
    • previousTransactionId

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder previousTransactionId(Hash256 previousTransactionId)
      Initializes the value for the previousTransactionId attribute.
      Parameters:
      previousTransactionId - The value for previousTransactionId
      Returns:
      this builder for use in a chained invocation
    • previousTransactionLedgerSequence

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence)
      Initializes the value for the previousTransactionLedgerSequence attribute.
      Parameters:
      previousTransactionLedgerSequence - The value for previousTransactionLedgerSequence
      Returns:
      this builder for use in a chained invocation
    • index

      @CanIgnoreReturnValue public final ImmutableDidObject.Builder index(Hash256 index)
      Initializes the value for the index attribute.
      Parameters:
      index - The value for index
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableDidObject build()
      Builds a new ImmutableDidObject.
      Returns:
      An immutable instance of DidObject
      Throws:
      IllegalStateException - if any required attributes are missing