Class Memo

java.lang.Object
org.stellar.sdk.Memo
Direct Known Subclasses:
MemoHash, MemoId, MemoNone, MemoReturnHash, MemoText

public abstract class Memo extends Object
The memo contains optional extra information. It is the responsibility of the client to interpret this value. Memos can be one of the following types:
  • MEMO_NONE: Empty memo.
  • MEMO_TEXT: A string up to 28-bytes long.
  • MEMO_ID: A 64 bit unsigned integer.
  • MEMO_HASH: A 32 byte hash.
  • MEMO_RETURN: A 32 byte hash intended to be interpreted as the hash of the transaction the sender is refunding.

Use static methods to generate any of above types.

See Also:
  • Constructor Details

    • Memo

      public Memo()
  • Method Details

    • none

      public static MemoNone none()
      Creates new MemoNone instance.
    • text

      public static MemoText text(String text)
      Creates new MemoText instance.
      Parameters:
      text - Memo text.
    • text

      public static MemoText text(byte[] text)
      Creates new MemoText instance.
      Parameters:
      text - Memo text as bytes.
    • id

      public static MemoId id(BigInteger id)
      Creates new MemoId instance.
      Parameters:
      id - Memo id.
    • id

      public static MemoId id(Long id)
      Creates new MemoId instance.
      Parameters:
      id - Memo id.
    • hash

      public static MemoHash hash(byte[] bytes)
      Creates new MemoHash instance from byte array.
      Parameters:
      bytes - Memo hash bytes.
    • hash

      public static MemoHash hash(String hexString)
      Creates new MemoHash instance from hex-encoded string
      Parameters:
      hexString - Memo hash hex-encoded string
    • returnHash

      public static MemoReturnHash returnHash(byte[] bytes)
      Creates new MemoReturnHash instance from byte array.
      Parameters:
      bytes - Memo return hash bytes.
    • returnHash

      public static MemoReturnHash returnHash(String hexString)
      Creates new MemoReturnHash instance from hex-encoded string.
      Parameters:
      hexString - Memo return hash hex-encoded string.
    • fromXdr

      public static Memo fromXdr(Memo memo)
    • equals

      public abstract boolean equals(Object o)
      Overrides:
      equals in class Object