Package org.stellar.sdk.xdr
Class Memo
java.lang.Object
org.stellar.sdk.xdr.Memo
- All Implemented Interfaces:
XdrElement
Memo's original definition in the XDR file is:
union Memo switch (MemoType type)
{
case MEMO_NONE:
void;
case MEMO_TEXT:
string text<28>;
case MEMO_ID:
uint64 id;
case MEMO_HASH:
Hash hash; // the hash of what to pull from the content server
case MEMO_RETURN:
Hash retHash; // the hash of the tx you are rejecting
};
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Memo.MemoBuilderbuilder()static Memodecode(XdrDataInputStream stream) static Memodecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic Memostatic MemofromXdrBase64(String xdr) static MemofromXdrByteArray(byte[] xdr) Value of thediscriminantfield.getHash()Value of thehashfield.getId()Value of theidfield.Value of theretHashfield.getText()Value of thetextfield.inthashCode()voidsetDiscriminant(MemoType discriminant) Value of thediscriminantfield.voidValue of thehashfield.voidValue of theidfield.voidsetRetHash(Hash retHash) Value of theretHashfield.voidValue of thetextfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
Memo
public Memo() -
Memo
Creates a newMemoinstance.- Parameters:
discriminant- thediscriminantfield valuetext- thetextfield valueid- theidfield valuehash- thehashfield valueretHash- theretHashfield value
-
-
Method Details
-
encode
Description copied from interface:XdrElementEncodes this value to XDR and writes it to the provided stream.- Specified by:
encodein interfaceXdrElement- Parameters:
stream- the destination XDR output stream- Throws:
IOException- if an I/O error occurs while writing the value
-
decode
- Throws:
IOException
-
decode
- Throws:
IOException
-
fromXdrBase64
- Throws:
IOException
-
fromXdrByteArray
- Throws:
IOException
-
toJson
Description copied from interface:XdrElementSerializes this value to JSON.- Specified by:
toJsonin interfaceXdrElement- Returns:
- the JSON representation of this value
-
fromJson
-
builder
-
toBuilder
-
getDiscriminant
Value of thediscriminantfield.- Returns:
- the
discriminantfield value
-
getText
Value of thetextfield.- Returns:
- the
textfield value
-
getId
Value of theidfield.- Returns:
- the
idfield value
-
getHash
Value of thehashfield.- Returns:
- the
hashfield value
-
getRetHash
Value of theretHashfield.- Returns:
- the
retHashfield value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setText
Value of thetextfield.- Parameters:
text- thetextfield value
-
setId
Value of theidfield.- Parameters:
id- theidfield value
-
setHash
Value of thehashfield.- Parameters:
hash- thehashfield value
-
setRetHash
Value of theretHashfield.- Parameters:
retHash- theretHashfield value
-
equals
-
hashCode
public int hashCode() -
toString
-