Class ManageSellOfferOp

java.lang.Object
org.stellar.sdk.xdr.ManageSellOfferOp
All Implemented Interfaces:
XdrElement

public class ManageSellOfferOp extends Object implements XdrElement
ManageSellOfferOp's original definition in the XDR file is:
 struct ManageSellOfferOp
 {
     Asset selling;
     Asset buying;
     int64 amount; // amount being sold. if set to 0, delete the offer
     Price price;  // price of thing being sold in terms of what you are buying

     // 0=create a new offer, otherwise edit an existing offer
     int64 offerID;
 };
 
  • Constructor Details

    • ManageSellOfferOp

      public ManageSellOfferOp()
    • ManageSellOfferOp

      public ManageSellOfferOp(Asset selling, Asset buying, Int64 amount, Price price, Int64 offerID)
      Creates a new ManageSellOfferOp instance.
      Parameters:
      selling - the selling field value
      buying - the buying field value
      amount - the amount field value
      price - the price field value
      offerID - the offerID field value
  • Method Details

    • encode

      public void encode(XdrDataOutputStream stream) throws IOException
      Description copied from interface: XdrElement
      Encodes this value to XDR and writes it to the provided stream.
      Specified by:
      encode in interface XdrElement
      Parameters:
      stream - the destination XDR output stream
      Throws:
      IOException - if an I/O error occurs while writing the value
    • decode

      public static ManageSellOfferOp decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

      public static ManageSellOfferOp decode(XdrDataInputStream stream) throws IOException
      Throws:
      IOException
    • fromXdrBase64

      public static ManageSellOfferOp fromXdrBase64(String xdr) throws IOException
      Throws:
      IOException
    • fromXdrByteArray

      public static ManageSellOfferOp fromXdrByteArray(byte[] xdr) throws IOException
      Throws:
      IOException
    • toJson

      public String toJson()
      Description copied from interface: XdrElement
      Serializes this value to JSON.
      Specified by:
      toJson in interface XdrElement
      Returns:
      the JSON representation of this value
    • fromJson

      public static ManageSellOfferOp fromJson(String json)
    • builder

    • toBuilder

    • getSelling

      public Asset getSelling()
      Value of the selling field.
      Returns:
      the selling field value
    • getBuying

      public Asset getBuying()
      Value of the buying field.
      Returns:
      the buying field value
    • getAmount

      public Int64 getAmount()
      Value of the amount field.
      Returns:
      the amount field value
    • getPrice

      public Price getPrice()
      Value of the price field.
      Returns:
      the price field value
    • getOfferID

      public Int64 getOfferID()
      Value of the offerID field.
      Returns:
      the offerID field value
    • setSelling

      public void setSelling(Asset selling)
      Value of the selling field.
      Parameters:
      selling - the selling field value
    • setBuying

      public void setBuying(Asset buying)
      Value of the buying field.
      Parameters:
      buying - the buying field value
    • setAmount

      public void setAmount(Int64 amount)
      Value of the amount field.
      Parameters:
      amount - the amount field value
    • setPrice

      public void setPrice(Price price)
      Value of the price field.
      Parameters:
      price - the price field value
    • setOfferID

      public void setOfferID(Int64 offerID)
      Value of the offerID field.
      Parameters:
      offerID - the offerID field value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object