Package org.stellar.sdk.xdr
Class LiquidityPoolEntry.LiquidityPoolEntryBody
java.lang.Object
org.stellar.sdk.xdr.LiquidityPoolEntry.LiquidityPoolEntryBody
- All Implemented Interfaces:
XdrElement
- Enclosing class:
LiquidityPoolEntry
LiquidityPoolEntryBody's original definition in the XDR file is:
union switch (LiquidityPoolType type)
{
case LIQUIDITY_POOL_CONSTANT_PRODUCT:
struct
{
LiquidityPoolConstantProductParameters params;
int64 reserveA; // amount of A in the pool
int64 reserveB; // amount of B in the pool
int64 totalPoolShares; // total number of pool shares issued
int64 poolSharesTrustLineCount; // number of trust lines for the
// associated pool shares
} constantProduct;
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classLiquidityPoolEntryConstantProduct's original definition in the XDR file is: -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionLiquidityPoolEntryBody(LiquidityPoolType discriminant, LiquidityPoolEntry.LiquidityPoolEntryBody.LiquidityPoolEntryConstantProduct constantProduct) Creates a newLiquidityPoolEntryBodyinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()decode(XdrDataInputStream stream) decode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanfromXdrBase64(String xdr) fromXdrByteArray(byte[] xdr) Value of theconstantProductfield.Value of thediscriminantfield.inthashCode()voidsetConstantProduct(LiquidityPoolEntry.LiquidityPoolEntryBody.LiquidityPoolEntryConstantProduct constantProduct) Value of theconstantProductfield.voidsetDiscriminant(LiquidityPoolType discriminant) Value of thediscriminantfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
LiquidityPoolEntryBody
public LiquidityPoolEntryBody() -
LiquidityPoolEntryBody
public LiquidityPoolEntryBody(LiquidityPoolType discriminant, LiquidityPoolEntry.LiquidityPoolEntryBody.LiquidityPoolEntryConstantProduct constantProduct) Creates a newLiquidityPoolEntryBodyinstance.- Parameters:
discriminant- thediscriminantfield valueconstantProduct- theconstantProductfield value
-
-
Method Details
-
encode
Description copied from interface:XdrElementEncodes this value to XDR and writes it to the provided stream.- Specified by:
encodein interfaceXdrElement- Parameters:
stream- the destination XDR output stream- Throws:
IOException- if an I/O error occurs while writing the value
-
decode
public static LiquidityPoolEntry.LiquidityPoolEntryBody decode(XdrDataInputStream stream, int maxDepth) throws IOException - Throws:
IOException
-
decode
public static LiquidityPoolEntry.LiquidityPoolEntryBody decode(XdrDataInputStream stream) throws IOException - Throws:
IOException
-
fromXdrBase64
public static LiquidityPoolEntry.LiquidityPoolEntryBody fromXdrBase64(String xdr) throws IOException - Throws:
IOException
-
fromXdrByteArray
public static LiquidityPoolEntry.LiquidityPoolEntryBody fromXdrByteArray(byte[] xdr) throws IOException - Throws:
IOException
-
toJson
Description copied from interface:XdrElementSerializes this value to JSON.- Specified by:
toJsonin interfaceXdrElement- Returns:
- the JSON representation of this value
-
fromJson
-
builder
-
toBuilder
-
getDiscriminant
Value of thediscriminantfield.- Returns:
- the
discriminantfield value
-
getConstantProduct
public LiquidityPoolEntry.LiquidityPoolEntryBody.LiquidityPoolEntryConstantProduct getConstantProduct()Value of theconstantProductfield.- Returns:
- the
constantProductfield value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setConstantProduct
public void setConstantProduct(LiquidityPoolEntry.LiquidityPoolEntryBody.LiquidityPoolEntryConstantProduct constantProduct) Value of theconstantProductfield.- Parameters:
constantProduct- theconstantProductfield value
-
equals
-
hashCode
public int hashCode() -
toString
-