Package org.stellar.sdk.xdr
Class TrustLineAsset
java.lang.Object
org.stellar.sdk.xdr.TrustLineAsset
- All Implemented Interfaces:
XdrElement
TrustLineAsset's original definition in the XDR file is:
union TrustLineAsset switch (AssetType type)
{
case ASSET_TYPE_NATIVE: // Not credit
void;
case ASSET_TYPE_CREDIT_ALPHANUM4:
AlphaNum4 alphaNum4;
case ASSET_TYPE_CREDIT_ALPHANUM12:
AlphaNum12 alphaNum12;
case ASSET_TYPE_POOL_SHARE:
PoolID liquidityPoolID;
// add other asset types here in the future
};
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionTrustLineAsset(AssetType discriminant, AlphaNum4 alphaNum4, AlphaNum12 alphaNum12, PoolID liquidityPoolID) Creates a newTrustLineAssetinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static TrustLineAssetdecode(XdrDataInputStream stream) static TrustLineAssetdecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic TrustLineAssetstatic TrustLineAssetfromXdrBase64(String xdr) static TrustLineAssetfromXdrByteArray(byte[] xdr) Value of thealphaNum12field.Value of thealphaNum4field.Value of thediscriminantfield.Value of theliquidityPoolIDfield.inthashCode()voidsetAlphaNum12(AlphaNum12 alphaNum12) Value of thealphaNum12field.voidsetAlphaNum4(AlphaNum4 alphaNum4) Value of thealphaNum4field.voidsetDiscriminant(AssetType discriminant) Value of thediscriminantfield.voidsetLiquidityPoolID(PoolID liquidityPoolID) Value of theliquidityPoolIDfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
TrustLineAsset
public TrustLineAsset() -
TrustLineAsset
public TrustLineAsset(AssetType discriminant, AlphaNum4 alphaNum4, AlphaNum12 alphaNum12, PoolID liquidityPoolID) Creates a newTrustLineAssetinstance.- Parameters:
discriminant- thediscriminantfield valuealphaNum4- thealphaNum4field valuealphaNum12- thealphaNum12field valueliquidityPoolID- theliquidityPoolIDfield 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
- Throws:
IOException
-
decode
- Throws:
IOException
-
fromXdrBase64
- Throws:
IOException
-
fromXdrByteArray
- 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
-
getAlphaNum4
Value of thealphaNum4field.- Returns:
- the
alphaNum4field value
-
getAlphaNum12
Value of thealphaNum12field.- Returns:
- the
alphaNum12field value
-
getLiquidityPoolID
Value of theliquidityPoolIDfield.- Returns:
- the
liquidityPoolIDfield value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setAlphaNum4
Value of thealphaNum4field.- Parameters:
alphaNum4- thealphaNum4field value
-
setAlphaNum12
Value of thealphaNum12field.- Parameters:
alphaNum12- thealphaNum12field value
-
setLiquidityPoolID
Value of theliquidityPoolIDfield.- Parameters:
liquidityPoolID- theliquidityPoolIDfield value
-
equals
-
hashCode
public int hashCode() -
toString
-