Package org.stellar.sdk.xdr
Class ChangeTrustAsset
java.lang.Object
org.stellar.sdk.xdr.ChangeTrustAsset
- All Implemented Interfaces:
XdrElement
ChangeTrustAsset's original definition in the XDR file is:
union ChangeTrustAsset 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:
LiquidityPoolParameters liquidityPool;
// 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
ConstructorsConstructorDescriptionChangeTrustAsset(AssetType discriminant, AlphaNum4 alphaNum4, AlphaNum12 alphaNum12, LiquidityPoolParameters liquidityPool) Creates a newChangeTrustAssetinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static ChangeTrustAssetdecode(XdrDataInputStream stream) static ChangeTrustAssetdecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic ChangeTrustAssetstatic ChangeTrustAssetfromXdrBase64(String xdr) static ChangeTrustAssetfromXdrByteArray(byte[] xdr) Value of thealphaNum12field.Value of thealphaNum4field.Value of thediscriminantfield.Value of theliquidityPoolfield.inthashCode()voidsetAlphaNum12(AlphaNum12 alphaNum12) Value of thealphaNum12field.voidsetAlphaNum4(AlphaNum4 alphaNum4) Value of thealphaNum4field.voidsetDiscriminant(AssetType discriminant) Value of thediscriminantfield.voidsetLiquidityPool(LiquidityPoolParameters liquidityPool) Value of theliquidityPoolfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
ChangeTrustAsset
public ChangeTrustAsset() -
ChangeTrustAsset
public ChangeTrustAsset(AssetType discriminant, AlphaNum4 alphaNum4, AlphaNum12 alphaNum12, LiquidityPoolParameters liquidityPool) Creates a newChangeTrustAssetinstance.- Parameters:
discriminant- thediscriminantfield valuealphaNum4- thealphaNum4field valuealphaNum12- thealphaNum12field valueliquidityPool- theliquidityPoolfield 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
-
getLiquidityPool
Value of theliquidityPoolfield.- Returns:
- the
liquidityPoolfield 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
-
setLiquidityPool
Value of theliquidityPoolfield.- Parameters:
liquidityPool- theliquidityPoolfield value
-
equals
-
hashCode
public int hashCode() -
toString
-