Package org.xrpl.xrpl4j.model.ledger
Class ImmutableAmmObject.Builder
java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableAmmObject.Builder
- Enclosing class:
ImmutableAmmObject
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 Summary
Modifier and TypeMethodDescriptionInitializes the value for theaccountattribute.addAllVoteSlots(Iterable<? extends VoteEntryWrapper> elements) Adds elements tovoteSlotslist.addVoteSlots(VoteEntryWrapper element) Adds one element tovoteSlotslist.addVoteSlots(VoteEntryWrapper... elements) Adds elements tovoteSlotslist.Initializes the value for theassetattribute.Initializes the value for theasset2attribute.auctionSlot(Optional<? extends AuctionSlot> auctionSlot) Initializes the optional valueauctionSlotto auctionSlot.auctionSlot(AuctionSlot auctionSlot) Initializes the optional valueauctionSlotto auctionSlot.build()Builds a newImmutableAmmObject.Fill a builder with attribute values from the providedAmmObjectinstance.Initializes the value for theindexattribute.lpTokenBalance(IssuedCurrencyAmount lpTokenBalance) Initializes the value for thelpTokenBalanceattribute.Initializes the value for theownerNodeattribute.tradingFee(TradingFee tradingFee) Initializes the value for thetradingFeeattribute.voteSlots(Iterable<? extends VoteEntryWrapper> elements) Sets or replaces all elements forvoteSlotslist.
-
Method Details
-
from
Fill a builder with attribute values from the providedAmmObjectinstance. 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:
thisbuilder for use in a chained invocation
-
asset
Initializes the value for theassetattribute.- Parameters:
asset- The value for asset- Returns:
thisbuilder for use in a chained invocation
-
asset2
Initializes the value for theasset2attribute.- Parameters:
asset2- The value for asset2- Returns:
thisbuilder for use in a chained invocation
-
account
Initializes the value for theaccountattribute.- Parameters:
account- The value for account- Returns:
thisbuilder for use in a chained invocation
-
auctionSlot
Initializes the optional valueauctionSlotto auctionSlot.- Parameters:
auctionSlot- The value for auctionSlot- Returns:
thisbuilder for chained invocation
-
auctionSlot
@CanIgnoreReturnValue public final ImmutableAmmObject.Builder auctionSlot(Optional<? extends AuctionSlot> auctionSlot) Initializes the optional valueauctionSlotto auctionSlot.- Parameters:
auctionSlot- The value for auctionSlot- Returns:
thisbuilder for use in a chained invocation
-
lpTokenBalance
@CanIgnoreReturnValue public final ImmutableAmmObject.Builder lpTokenBalance(IssuedCurrencyAmount lpTokenBalance) Initializes the value for thelpTokenBalanceattribute.- Parameters:
lpTokenBalance- The value for lpTokenBalance- Returns:
thisbuilder for use in a chained invocation
-
tradingFee
Initializes the value for thetradingFeeattribute.- Parameters:
tradingFee- The value for tradingFee- Returns:
thisbuilder for use in a chained invocation
-
addVoteSlots
@CanIgnoreReturnValue public final ImmutableAmmObject.Builder addVoteSlots(VoteEntryWrapper element) Adds one element tovoteSlotslist.- Parameters:
element- A voteSlots element- Returns:
thisbuilder for use in a chained invocation
-
addVoteSlots
@CanIgnoreReturnValue public final ImmutableAmmObject.Builder addVoteSlots(VoteEntryWrapper... elements) Adds elements tovoteSlotslist.- Parameters:
elements- An array of voteSlots elements- Returns:
thisbuilder for use in a chained invocation
-
voteSlots
@CanIgnoreReturnValue public final ImmutableAmmObject.Builder voteSlots(Iterable<? extends VoteEntryWrapper> elements) Sets or replaces all elements forvoteSlotslist.- Parameters:
elements- An iterable of voteSlots elements- Returns:
thisbuilder for use in a chained invocation
-
addAllVoteSlots
@CanIgnoreReturnValue public final ImmutableAmmObject.Builder addAllVoteSlots(Iterable<? extends VoteEntryWrapper> elements) Adds elements tovoteSlotslist.- Parameters:
elements- An iterable of voteSlots elements- Returns:
thisbuilder for use in a chained invocation
-
ownerNode
Initializes the value for theownerNodeattribute.- Parameters:
ownerNode- The value for ownerNode- Returns:
thisbuilder for use in a chained invocation
-
index
Initializes the value for theindexattribute.- Parameters:
index- The value for index- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableAmmObject.- Returns:
- An immutable instance of AmmObject
- Throws:
IllegalStateException- if any required attributes are missing
-