Package org.stellar.sdk.xdr
Class AssetCode
java.lang.Object
org.stellar.sdk.xdr.AssetCode
- All Implemented Interfaces:
XdrElement
AssetCode's original definition in the XDR file is:
union AssetCode switch (AssetType type)
{
case ASSET_TYPE_CREDIT_ALPHANUM4:
AssetCode4 assetCode4;
case ASSET_TYPE_CREDIT_ALPHANUM12:
AssetCode12 assetCode12;
// 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
ConstructorsConstructorDescriptionAssetCode(AssetType discriminant, AssetCode4 assetCode4, AssetCode12 assetCode12) Creates a newAssetCodeinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic AssetCode.AssetCodeBuilderbuilder()static AssetCodedecode(XdrDataInputStream stream) static AssetCodedecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic AssetCodestatic AssetCodefromXdrBase64(String xdr) static AssetCodefromXdrByteArray(byte[] xdr) Value of theassetCode12field.Value of theassetCode4field.Value of thediscriminantfield.inthashCode()voidsetAssetCode12(AssetCode12 assetCode12) Value of theassetCode12field.voidsetAssetCode4(AssetCode4 assetCode4) Value of theassetCode4field.voidsetDiscriminant(AssetType discriminant) Value of thediscriminantfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
AssetCode
public AssetCode() -
AssetCode
Creates a newAssetCodeinstance.- Parameters:
discriminant- thediscriminantfield valueassetCode4- theassetCode4field valueassetCode12- theassetCode12field 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
-
getAssetCode4
Value of theassetCode4field.- Returns:
- the
assetCode4field value
-
getAssetCode12
Value of theassetCode12field.- Returns:
- the
assetCode12field value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setAssetCode4
Value of theassetCode4field.- Parameters:
assetCode4- theassetCode4field value
-
setAssetCode12
Value of theassetCode12field.- Parameters:
assetCode12- theassetCode12field value
-
equals
-
hashCode
public int hashCode() -
toString
-