Package org.stellar.sdk.xdr
Class TrustLineEntry
java.lang.Object
org.stellar.sdk.xdr.TrustLineEntry
- All Implemented Interfaces:
XdrElement
TrustLineEntry's original definition in the XDR file is:
struct TrustLineEntry
{
AccountID accountID; // account this trustline belongs to
TrustLineAsset asset; // type of asset (with issuer)
int64 balance; // how much of this asset the user has.
// Asset defines the unit for this;
int64 limit; // balance cannot be above this
uint32 flags; // see TrustLineFlags
// reserved for future use
union switch (int v)
{
case 0:
void;
case 1:
struct
{
Liabilities liabilities;
union switch (int v)
{
case 0:
void;
case 2:
TrustLineEntryExtensionV2 v2;
}
ext;
} v1;
}
ext;
};
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classTrustLineEntryExt's original definition in the XDR file is: -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionTrustLineEntry(AccountID accountID, TrustLineAsset asset, Int64 balance, Int64 limit, Uint32 flags, TrustLineEntry.TrustLineEntryExt ext) Creates a newTrustLineEntryinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static TrustLineEntrydecode(XdrDataInputStream stream) static TrustLineEntrydecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic TrustLineEntrystatic TrustLineEntryfromXdrBase64(String xdr) static TrustLineEntryfromXdrByteArray(byte[] xdr) Value of theaccountIDfield.getAsset()Value of theassetfield.Value of thebalancefield.getExt()Value of theextfield.getFlags()Value of theflagsfield.getLimit()Value of thelimitfield.inthashCode()voidsetAccountID(AccountID accountID) Value of theaccountIDfield.voidsetAsset(TrustLineAsset asset) Value of theassetfield.voidsetBalance(Int64 balance) Value of thebalancefield.voidValue of theextfield.voidValue of theflagsfield.voidValue of thelimitfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
TrustLineEntry
public TrustLineEntry() -
TrustLineEntry
public TrustLineEntry(AccountID accountID, TrustLineAsset asset, Int64 balance, Int64 limit, Uint32 flags, TrustLineEntry.TrustLineEntryExt ext) Creates a newTrustLineEntryinstance.- Parameters:
accountID- theaccountIDfield valueasset- theassetfield valuebalance- thebalancefield valuelimit- thelimitfield valueflags- theflagsfield valueext- theextfield 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
-
getAccountID
Value of theaccountIDfield.- Returns:
- the
accountIDfield value
-
getAsset
Value of theassetfield.- Returns:
- the
assetfield value
-
getBalance
Value of thebalancefield.- Returns:
- the
balancefield value
-
getLimit
Value of thelimitfield.- Returns:
- the
limitfield value
-
getFlags
Value of theflagsfield.- Returns:
- the
flagsfield value
-
getExt
Value of theextfield.- Returns:
- the
extfield value
-
setAccountID
Value of theaccountIDfield.- Parameters:
accountID- theaccountIDfield value
-
setAsset
Value of theassetfield.- Parameters:
asset- theassetfield value
-
setBalance
Value of thebalancefield.- Parameters:
balance- thebalancefield value
-
setLimit
Value of thelimitfield.- Parameters:
limit- thelimitfield value
-
setFlags
Value of theflagsfield.- Parameters:
flags- theflagsfield value
-
setExt
Value of theextfield.- Parameters:
ext- theextfield value
-
equals
-
hashCode
public int hashCode() -
toString
-