Package org.xrpl.xrpl4j.model.ledger
Class ImmutableAmmObject
java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableAmmObject
- All Implemented Interfaces:
AmmObject,LedgerObject
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableAmmObject
extends Object
implements AmmObject
Immutable implementation of
AmmObject.
Use the builder to create immutable instances:
ImmutableAmmObject.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.xrpl.xrpl4j.model.ledger.LedgerObject
LedgerObject.LedgerEntryType -
Method Summary
Modifier and TypeMethodDescriptionaccount()The address of the special account that holds this AMM's assets.asset()The definition for one of the two assets this AMM holds.asset2()The definition for the other asset this AMM holds.Details of the current owner of the auction slot.static ImmutableAmmObject.Builderbuilder()Creates a builder forImmutableAmmObject.static ImmutableAmmObjectCreates an immutable copy of aAmmObjectvalue.booleanThis instance is equal to all instances ofImmutableAmmObjectthat have equal attribute values.flags()A bit-map of boolean flags.inthashCode()Computes a hash code from attributes:ledgerEntryType,flags,asset,asset2,account,auctionSlot,lpTokenBalance,tradingFee,voteSlots,ownerNode,voteSlotsUnwrapped,index.index()The unique ID of theAmmObject.The type of ledger object, which will always be "AMM" in this case.The total outstanding balance of liquidity provider tokens from this AMM instance.A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages.toString()Prints the immutable valueAmmObjectwith attribute values.The percentage fee to be charged for trades against this AMM instance, in units of 1/10,000.com.google.common.collect.ImmutableList<VoteEntryWrapper> A list of vote objects, representing votes on the pool's trading fee.final ImmutableAmmObjectwithAccount(Address value) Copy the current immutable object by setting a value for theaccountattribute.final ImmutableAmmObjectCopy the current immutable object by setting a value for theassetattribute.final ImmutableAmmObjectwithAsset2(Issue value) Copy the current immutable object by setting a value for theasset2attribute.final ImmutableAmmObjectwithAuctionSlot(Optional<? extends AuctionSlot> optional) Copy the current immutable object by setting an optional value for theauctionSlotattribute.final ImmutableAmmObjectwithAuctionSlot(AuctionSlot value) Copy the current immutable object by setting a present value for the optionalauctionSlotattribute.final ImmutableAmmObjectCopy the current immutable object by setting a value for theindexattribute.final ImmutableAmmObjectCopy the current immutable object by setting a value for thelpTokenBalanceattribute.final ImmutableAmmObjectwithOwnerNode(String value) Copy the current immutable object by setting a value for theownerNodeattribute.final ImmutableAmmObjectwithTradingFee(TradingFee value) Copy the current immutable object by setting a value for thetradingFeeattribute.final ImmutableAmmObjectwithVoteSlots(Iterable<? extends VoteEntryWrapper> elements) Copy the current immutable object with elements that replace the content ofvoteSlots.final ImmutableAmmObjectwithVoteSlots(VoteEntryWrapper... elements) Copy the current immutable object with elements that replace the content ofvoteSlots.
-
Method Details
-
ledgerEntryType
The type of ledger object, which will always be "AMM" in this case.- Specified by:
ledgerEntryTypein interfaceAmmObject- Returns:
- Always returns
LedgerObject.LedgerEntryType.AMM.
-
flags
A bit-map of boolean flags. No flags are defined forAmmObject, so this value is always 0.- Specified by:
flagsin interfaceAmmObject- Returns:
- Always
Flags.UNSET.
-
asset
The definition for one of the two assets this AMM holds. -
asset2
The definition for the other asset this AMM holds. -
account
The address of the special account that holds this AMM's assets. -
auctionSlot
Details of the current owner of the auction slot.- Specified by:
auctionSlotin interfaceAmmObject- Returns:
- An
AuctionSlot.
-
lpTokenBalance
The total outstanding balance of liquidity provider tokens from this AMM instance. The holders of these tokens can vote on the AMM's trading fee in proportion to their holdings, or redeem the tokens for a share of the AMM's assets which grows with the trading fees collected.- Specified by:
lpTokenBalancein interfaceAmmObject- Returns:
- An
IssuedCurrencyAmount.
-
tradingFee
The percentage fee to be charged for trades against this AMM instance, in units of 1/10,000. The maximum value is 1000, for a 1% fee.- Specified by:
tradingFeein interfaceAmmObject- Returns:
- A
TradingFee.
-
voteSlots
A list of vote objects, representing votes on the pool's trading fee.- Specified by:
voteSlotsin interfaceAmmObject- Returns:
- A
ListofVoteEntryWrappers.
-
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.
-
voteSlotsUnwrapped
- Specified by:
voteSlotsUnwrappedin interfaceAmmObject- Returns:
- A
ListofVoteEntry.
-
index
The unique ID of theAmmObject. -
withAsset
Copy the current immutable object by setting a value for theassetattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for asset- Returns:
- A modified copy of the
thisobject
-
withAsset2
Copy the current immutable object by setting a value for theasset2attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for asset2- Returns:
- A modified copy of the
thisobject
-
withAccount
Copy the current immutable object by setting a value for theaccountattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for account- Returns:
- A modified copy of the
thisobject
-
withAuctionSlot
Copy the current immutable object by setting a present value for the optionalauctionSlotattribute.- Parameters:
value- The value for auctionSlot- Returns:
- A modified copy of
thisobject
-
withAuctionSlot
Copy the current immutable object by setting an optional value for theauctionSlotattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for auctionSlot- Returns:
- A modified copy of
thisobject
-
withLpTokenBalance
Copy the current immutable object by setting a value for thelpTokenBalanceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for lpTokenBalance- Returns:
- A modified copy of the
thisobject
-
withTradingFee
Copy the current immutable object by setting a value for thetradingFeeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for tradingFee- Returns:
- A modified copy of the
thisobject
-
withVoteSlots
Copy the current immutable object with elements that replace the content ofvoteSlots.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withVoteSlots
Copy the current immutable object with elements that replace the content ofvoteSlots. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of voteSlots elements to set- Returns:
- A modified copy of
thisobject
-
withOwnerNode
Copy the current immutable object by setting a value for theownerNodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ownerNode- Returns:
- A modified copy of the
thisobject
-
withIndex
Copy the current immutable object by setting a value for theindexattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableAmmObjectthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:ledgerEntryType,flags,asset,asset2,account,auctionSlot,lpTokenBalance,tradingFee,voteSlots,ownerNode,voteSlotsUnwrapped,index. -
toString
Prints the immutable valueAmmObjectwith attribute values. -
copyOf
Creates an immutable copy of aAmmObjectvalue. 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 AmmObject instance
-
builder
Creates a builder forImmutableAmmObject.ImmutableAmmObject.builder() .asset(org.xrpl.xrpl4j.model.ledger.Issue) // requiredasset.asset2(org.xrpl.xrpl4j.model.ledger.Issue) // requiredasset2.account(org.xrpl.xrpl4j.model.transactions.Address) // requiredaccount.auctionSlot(org.xrpl.xrpl4j.model.ledger.AuctionSlot) // optionalauctionSlot.lpTokenBalance(org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount) // requiredlpTokenBalance.tradingFee(org.xrpl.xrpl4j.model.transactions.TradingFee) // requiredtradingFee.addVoteSlots|addAllVoteSlots(org.xrpl.xrpl4j.model.ledger.VoteEntryWrapper) //voteSlotselements .ownerNode(String) // requiredownerNode.index(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredindex.build();- Returns:
- A new ImmutableAmmObject builder
-