Class AssetTypeCreditAlphaNum4

All Implemented Interfaces:
Comparable<Asset>

public final class AssetTypeCreditAlphaNum4 extends AssetTypeCreditAlphaNum
Represents all assets with codes 1-4 characters long.
See Also:
  • Constructor Details

    • AssetTypeCreditAlphaNum4

      public AssetTypeCreditAlphaNum4(String code, String issuer)
      Class constructor
      Parameters:
      code - Asset code
      issuer - Asset issuer
      Throws:
      IllegalArgumentException - when code is invalid
  • Method Details

    • getType

      public AssetType getType()
      Description copied from class: Asset
      Returns asset type.
      Specified by:
      getType in class Asset
    • fromXdr

      public static AssetTypeCreditAlphaNum4 fromXdr(AlphaNum4 alphaNum4)
    • toXdr

      public Asset toXdr()
      Description copied from class: Asset
      Generates XDR object from a given Asset object
      Specified by:
      toXdr in class Asset
    • compareTo

      public int compareTo(@NonNull @NonNull Asset other)
      Description copied from class: Asset
      Compares two assets.
      1. First compare the type (eg. native before alphanum4 before alphanum12).
      2. If the types are equal, compare the assets codes.
      3. If the asset codes are equal, compare the issuers.
      Specified by:
      compareTo in interface Comparable<Asset>
      Specified by:
      compareTo in class Asset
      Parameters:
      other - the object to be compared.
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.