public class TrustLineAsset
extends java.lang.Object
Constructor and Description |
---|
TrustLineAsset(@NonNull Asset asset)
Creates a TrustLineAsset for a regular asset.
|
TrustLineAsset(@NonNull java.lang.String liquidityPoolId)
Creates a TrustLineAsset for a liquidity pool share.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static TrustLineAsset |
fromXdr(TrustLineAsset trustLineAsset)
Creates a TrustLineAsset from its XDR representation.
|
Asset |
getAsset()
The asset for which the trustline is established.
|
@NonNull AssetType |
getAssetType()
The type of the asset.
|
java.lang.String |
getLiquidityPoolId()
The ID of the liquidity pool for which the trustline is established.
|
int |
hashCode() |
TrustLineAsset |
toXdr()
Converts this TrustLineAsset to its XDR representation.
|
public TrustLineAsset(@NonNull @NonNull Asset asset)
asset
- The asset for which the trustline is created.public TrustLineAsset(@NonNull @NonNull java.lang.String liquidityPoolId)
liquidityPoolId
- The ID of the liquidity pool.public TrustLineAsset toXdr()
public static TrustLineAsset fromXdr(TrustLineAsset trustLineAsset)
trustLineAsset
- The XDR representation of the TrustLineAsset.java.lang.IllegalArgumentException
- if the asset type is unknown.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@NonNull public @NonNull AssetType getAssetType()
@Nullable public Asset getAsset()
If assetType is one of AssetType.ASSET_TYPE_NATIVE
, AssetType.ASSET_TYPE_CREDIT_ALPHANUM4
or AssetType.ASSET_TYPE_CREDIT_ALPHANUM12
then
this field will be set.
@Nullable public java.lang.String getLiquidityPoolId()
If assetType is AssetType.ASSET_TYPE_POOL_SHARE
then this field will be set.