Package org.stellar.sdk.xdr
Class Asset
java.lang.Object
org.stellar.sdk.xdr.Asset
- All Implemented Interfaces:
XdrElement
Asset's original definition in the XDR file is:
union Asset switch (AssetType type) { case ASSET_TYPE_NATIVE: // Not credit void; case ASSET_TYPE_CREDIT_ALPHANUM4: AlphaNum4 alphaNum4; case ASSET_TYPE_CREDIT_ALPHANUM12: AlphaNum12 alphaNum12; // add other asset types here in the future };
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAsset()
Asset
(AssetType discriminant, AlphaNum4 alphaNum4, AlphaNum12 alphaNum12) -
Method Summary
Modifier and TypeMethodDescriptionstatic Asset.AssetBuilder
builder()
static Asset
decode
(XdrDataInputStream stream) void
encode
(XdrDataOutputStream stream) boolean
static Asset
fromXdrBase64
(String xdr) static Asset
fromXdrByteArray
(byte[] xdr) int
hashCode()
void
setAlphaNum12
(AlphaNum12 alphaNum12) void
setAlphaNum4
(AlphaNum4 alphaNum4) void
setDiscriminant
(AssetType discriminant) toString()
Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
Asset
public Asset() -
Asset
-
-
Method Details
-
encode
- Specified by:
encode
in interfaceXdrElement
- Throws:
IOException
-
decode
- Throws:
IOException
-
fromXdrBase64
- Throws:
IOException
-
fromXdrByteArray
- Throws:
IOException
-
builder
-
toBuilder
-
getDiscriminant
-
getAlphaNum4
-
getAlphaNum12
-
setDiscriminant
-
setAlphaNum4
-
setAlphaNum12
-
equals
-
hashCode
public int hashCode() -
toString
-