Package org.stellar.sdk.xdr
Class OfferEntry
java.lang.Object
org.stellar.sdk.xdr.OfferEntry
- All Implemented Interfaces:
XdrElement
OfferEntry's original definition in the XDR file is:
struct OfferEntry
{
AccountID sellerID;
int64 offerID;
Asset selling; // A
Asset buying; // B
int64 amount; // amount of A
/* price for this offer:
price of A in terms of B
price=AmountB/AmountA=priceNumerator/priceDenominator
price is after fees
*/
Price price;
uint32 flags; // see OfferEntryFlags
// reserved for future use
union switch (int v)
{
case 0:
void;
}
ext;
};
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classOfferEntryExt's original definition in the XDR file is: -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionOfferEntry(AccountID sellerID, Int64 offerID, Asset selling, Asset buying, Int64 amount, Price price, Uint32 flags, OfferEntry.OfferEntryExt ext) Creates a newOfferEntryinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic OfferEntry.OfferEntryBuilderbuilder()static OfferEntrydecode(XdrDataInputStream stream) static OfferEntrydecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic OfferEntrystatic OfferEntryfromXdrBase64(String xdr) static OfferEntryfromXdrByteArray(byte[] xdr) Value of theamountfield.Value of thebuyingfield.getExt()Value of theextfield.getFlags()Value of theflagsfield.Value of theofferIDfield.getPrice()Value of thepricefield.Value of thesellerIDfield.Value of thesellingfield.inthashCode()voidValue of theamountfield.voidValue of thebuyingfield.voidValue of theextfield.voidValue of theflagsfield.voidsetOfferID(Int64 offerID) Value of theofferIDfield.voidValue of thepricefield.voidsetSellerID(AccountID sellerID) Value of thesellerIDfield.voidsetSelling(Asset selling) Value of thesellingfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
OfferEntry
public OfferEntry() -
OfferEntry
public OfferEntry(AccountID sellerID, Int64 offerID, Asset selling, Asset buying, Int64 amount, Price price, Uint32 flags, OfferEntry.OfferEntryExt ext) Creates a newOfferEntryinstance.- Parameters:
sellerID- thesellerIDfield valueofferID- theofferIDfield valueselling- thesellingfield valuebuying- thebuyingfield valueamount- theamountfield valueprice- thepricefield 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
-
getSellerID
Value of thesellerIDfield.- Returns:
- the
sellerIDfield value
-
getOfferID
Value of theofferIDfield.- Returns:
- the
offerIDfield value
-
getSelling
Value of thesellingfield.- Returns:
- the
sellingfield value
-
getBuying
Value of thebuyingfield.- Returns:
- the
buyingfield value
-
getAmount
Value of theamountfield.- Returns:
- the
amountfield value
-
getPrice
Value of thepricefield.- Returns:
- the
pricefield value
-
getFlags
Value of theflagsfield.- Returns:
- the
flagsfield value
-
getExt
Value of theextfield.- Returns:
- the
extfield value
-
setSellerID
Value of thesellerIDfield.- Parameters:
sellerID- thesellerIDfield value
-
setOfferID
Value of theofferIDfield.- Parameters:
offerID- theofferIDfield value
-
setSelling
Value of thesellingfield.- Parameters:
selling- thesellingfield value
-
setBuying
Value of thebuyingfield.- Parameters:
buying- thebuyingfield value
-
setAmount
Value of theamountfield.- Parameters:
amount- theamountfield value
-
setPrice
Value of thepricefield.- Parameters:
price- thepricefield value
-
setFlags
Value of theflagsfield.- Parameters:
flags- theflagsfield value
-
setExt
Value of theextfield.- Parameters:
ext- theextfield value
-
equals
-
hashCode
public int hashCode() -
toString
-