Class ImmutableOfferObject.Builder

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

@NotThreadSafe public static final class ImmutableOfferObject.Builder extends Object
Builds instances of type ImmutableOfferObject. 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 ImmutableOfferObject.Builder from(OfferObject instance)
      Fill a builder with attribute values from the provided OfferObject instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • account

      @CanIgnoreReturnValue public final ImmutableOfferObject.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
    • flags

      @CanIgnoreReturnValue public final ImmutableOfferObject.Builder flags(OfferFlags flags)
      Initializes the value for the flags attribute.
      Parameters:
      flags - The value for flags
      Returns:
      this builder for use in a chained invocation
    • sequence

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

      @CanIgnoreReturnValue public final ImmutableOfferObject.Builder takerPays(CurrencyAmount takerPays)
      Initializes the value for the takerPays attribute.
      Parameters:
      takerPays - The value for takerPays
      Returns:
      this builder for use in a chained invocation
    • takerGets

      @CanIgnoreReturnValue public final ImmutableOfferObject.Builder takerGets(CurrencyAmount takerGets)
      Initializes the value for the takerGets attribute.
      Parameters:
      takerGets - The value for takerGets
      Returns:
      this builder for use in a chained invocation
    • bookDirectory

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

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

      @CanIgnoreReturnValue public final ImmutableOfferObject.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 ImmutableOfferObject.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 ImmutableOfferObject.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
    • expiration

      @CanIgnoreReturnValue public final ImmutableOfferObject.Builder expiration(com.google.common.primitives.UnsignedInteger expiration)
      Initializes the optional value expiration to expiration.
      Parameters:
      expiration - The value for expiration
      Returns:
      this builder for chained invocation
    • expiration

      @CanIgnoreReturnValue public final ImmutableOfferObject.Builder expiration(Optional<? extends com.google.common.primitives.UnsignedInteger> expiration)
      Initializes the optional value expiration to expiration.
      Parameters:
      expiration - The value for expiration
      Returns:
      this builder for use in a chained invocation
    • domainId

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

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

      @CanIgnoreReturnValue public final ImmutableOfferObject.Builder addAdditionalBooks(BookWrapper element)
      Adds one element to additionalBooks list.
      Parameters:
      element - A additionalBooks element
      Returns:
      this builder for use in a chained invocation
    • addAdditionalBooks

      @CanIgnoreReturnValue public final ImmutableOfferObject.Builder addAdditionalBooks(BookWrapper... elements)
      Adds elements to additionalBooks list.
      Parameters:
      elements - An array of additionalBooks elements
      Returns:
      this builder for use in a chained invocation
    • additionalBooks

      @CanIgnoreReturnValue public final ImmutableOfferObject.Builder additionalBooks(Iterable<? extends BookWrapper> elements)
      Sets or replaces all elements for additionalBooks list.
      Parameters:
      elements - An iterable of additionalBooks elements
      Returns:
      this builder for use in a chained invocation
    • addAllAdditionalBooks

      @CanIgnoreReturnValue public final ImmutableOfferObject.Builder addAllAdditionalBooks(Iterable<? extends BookWrapper> elements)
      Adds elements to additionalBooks list.
      Parameters:
      elements - An iterable of additionalBooks elements
      Returns:
      this builder for use in a chained invocation
    • index

      @CanIgnoreReturnValue public final ImmutableOfferObject.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 ImmutableOfferObject build()
      Builds a new ImmutableOfferObject.
      Returns:
      An immutable instance of OfferObject
      Throws:
      IllegalStateException - if any required attributes are missing