Class ImmutableAmmObject.Builder

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

@NotThreadSafe public static final class ImmutableAmmObject.Builder extends Object
Builds instances of type ImmutableAmmObject. 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 ImmutableAmmObject.Builder from(AmmObject instance)
      Fill a builder with attribute values from the provided AmmObject 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
    • asset

      @CanIgnoreReturnValue public final ImmutableAmmObject.Builder asset(Issue asset)
      Initializes the value for the asset attribute.
      Parameters:
      asset - The value for asset
      Returns:
      this builder for use in a chained invocation
    • asset2

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

      @CanIgnoreReturnValue public final ImmutableAmmObject.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
    • auctionSlot

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

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

      @CanIgnoreReturnValue public final ImmutableAmmObject.Builder lpTokenBalance(IssuedCurrencyAmount lpTokenBalance)
      Initializes the value for the lpTokenBalance attribute.
      Parameters:
      lpTokenBalance - The value for lpTokenBalance
      Returns:
      this builder for use in a chained invocation
    • tradingFee

      @CanIgnoreReturnValue public final ImmutableAmmObject.Builder tradingFee(TradingFee tradingFee)
      Initializes the value for the tradingFee attribute.
      Parameters:
      tradingFee - The value for tradingFee
      Returns:
      this builder for use in a chained invocation
    • addVoteSlots

      @CanIgnoreReturnValue public final ImmutableAmmObject.Builder addVoteSlots(VoteEntryWrapper element)
      Adds one element to voteSlots list.
      Parameters:
      element - A voteSlots element
      Returns:
      this builder for use in a chained invocation
    • addVoteSlots

      @CanIgnoreReturnValue public final ImmutableAmmObject.Builder addVoteSlots(VoteEntryWrapper... elements)
      Adds elements to voteSlots list.
      Parameters:
      elements - An array of voteSlots elements
      Returns:
      this builder for use in a chained invocation
    • voteSlots

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

      @CanIgnoreReturnValue public final ImmutableAmmObject.Builder addAllVoteSlots(Iterable<? extends VoteEntryWrapper> elements)
      Adds elements to voteSlots list.
      Parameters:
      elements - An iterable of voteSlots elements
      Returns:
      this builder for use in a chained invocation
    • ownerNode

      @CanIgnoreReturnValue public final ImmutableAmmObject.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
    • index

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