Class TrustLineAsset

java.lang.Object
org.stellar.sdk.TrustLineAsset
All Implemented Interfaces:
Comparable<TrustLineAsset>
Direct Known Subclasses:
LiquidityPoolShareTrustLineAsset, TrustLineAsset.Wrapper

public abstract class TrustLineAsset extends Object implements Comparable<TrustLineAsset>
TrustLineAsset class.
See Also:
  • Method Details

    • create

      public static TrustLineAsset create(String canonicalForm)
      Parses an asset string and returns the equivalent TrustLineAsset instance. The asset string is expected to either be "native" or a string of the form "CODE:ISSUER"
      Parameters:
      canonicalForm - Canonical string representation of an asset
    • create

      public static TrustLineAsset create(String type, String code, String issuer)
      Parses type, code, issuer and returns the equivalent TrustLineAsset instance.
      Parameters:
      type - the asset type
      code - the asset code
      issuer - the assset issuer
      Returns:
      TrustLineAsset
    • create

      public static TrustLineAsset create(Asset asset)
      Converts Asset to TrustLineAsset
      Parameters:
      asset - the Asset
      Returns:
      TrustLineAsset
    • create

      public static TrustLineAsset create(LiquidityPoolParameters params)
      Creates a TrustLineAsset from LiquidityPoolParameters
      Parameters:
      params - the LiquidityPoolParameters
      Returns:
      TrustLineAsset
    • create

      public static TrustLineAsset create(LiquidityPoolID id)
      Creates a TrustLineAsset from LiquidityPoolID
      Parameters:
      id - the LiquidityPoolID
      Returns:
      TrustLineAsset
    • create

      public static TrustLineAsset create(ChangeTrustAsset.Wrapper wrapper)
      Creates a TrustLineAsset from ChangeTrustAsset
      Parameters:
      wrapper - the ChangeTrustAsset wrapper
      Returns:
      TrustLineAsset
    • create

      public static TrustLineAsset create(LiquidityPoolShareChangeTrustAsset share)
      Create TrustLineAsset from LiquidityPoolShareChangeTrustAsset
      Parameters:
      share - the LiquidityPoolShareChangeTrustAsset
      Returns:
      TrustLineAsset
    • createNonNativeAsset

      public static TrustLineAsset createNonNativeAsset(String code, String issuer)
      Creates TrustLineAsset based on a code length and issuer only
      Parameters:
      code - the TrustLineAsset code
      issuer - the TrustLineAsset issuer
    • fromXdr

      public static TrustLineAsset fromXdr(TrustLineAsset xdr)
      Generates TrustLineAsset object from a given XDR object
      Parameters:
      xdr - XDR object
    • equals

      public abstract boolean equals(Object object)
      Overrides:
      equals in class Object
    • compareTo

      public abstract int compareTo(@NonNull @NonNull TrustLineAsset other)
      Specified by:
      compareTo in interface Comparable<TrustLineAsset>
    • getType

      public abstract String getType()
      Get the asset type
      Returns:
      the asset type
    • toXdr

      public abstract TrustLineAsset toXdr()
      Generates XDR object from a given TrustLineAsset object
      Returns:
      xdr model