Package org.stellar.sdk
Class ChangeTrustAsset
java.lang.Object
org.stellar.sdk.ChangeTrustAsset
Represents an asset in a change trust operation on the Stellar network. This class can represent
both regular assets and liquidity pool share for change trustline operation.
- See Also:
-
Constructor Summary
ConstructorDescriptionChangeTrustAsset
(@NonNull Asset asset) Creates a ChangeTrustAsset for a regular asset.ChangeTrustAsset
(@NonNull LiquidityPool liquidityPool) Creates a ChangeTrustAsset for a liquidity pool share. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static ChangeTrustAsset
fromXdr
(ChangeTrustAsset changeTrustAsset) Creates a ChangeTrustAsset from its XDR representation.getAsset()
The asset for which the trustline is being changed.@NonNull AssetType
The type of the asset.The liquidity pool for which the trustline is being changed.int
hashCode()
toString()
toXdr()
Converts this ChangeTrustAsset to its XDR representation.
-
Constructor Details
-
ChangeTrustAsset
Creates a ChangeTrustAsset for a regular asset.- Parameters:
asset
- The asset for which the trust is being changed.
-
ChangeTrustAsset
Creates a ChangeTrustAsset for a liquidity pool share.- Parameters:
liquidityPool
- The liquidity pool for which the trust is being changed.
-
-
Method Details
-
toXdr
Converts this ChangeTrustAsset to its XDR representation.- Returns:
- The XDR representation of this ChangeTrustAsset.
-
fromXdr
Creates a ChangeTrustAsset from its XDR representation.- Parameters:
changeTrustAsset
- The XDR representation of the ChangeTrustAsset.- Returns:
- A new ChangeTrustAsset instance.
- Throws:
IllegalArgumentException
- if the asset type is unknown.
-
getAssetType
The type of the asset. -
getAsset
The asset for which the trustline is being changed. This is null if the change trust operation is for a liquidity pool share.If assetType is one of
AssetType.ASSET_TYPE_NATIVE
,AssetType.ASSET_TYPE_CREDIT_ALPHANUM4
orAssetType.ASSET_TYPE_CREDIT_ALPHANUM12
then this field will be set. -
getLiquidityPool
The liquidity pool for which the trustline is being changed. This is null if the change trust operation is for a regular asset.If assetType is
AssetType.ASSET_TYPE_POOL_SHARE
then this field will be set. -
equals
-
hashCode
public int hashCode() -
toString
-