Class ManageBuyOfferOp

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

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

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

    • ManageBuyOfferOp

      public ManageBuyOfferOp()
    • ManageBuyOfferOp

      public ManageBuyOfferOp(Asset selling, Asset buying, Int64 buyAmount, Price price, Int64 offerID)
      Creates a new ManageBuyOfferOp instance.
      Parameters:
      selling - the selling field value
      buying - the buying field value
      buyAmount - the buyAmount 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 ManageBuyOfferOp decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

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

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

      public static ManageBuyOfferOp 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 ManageBuyOfferOp 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
    • getBuyAmount

      public Int64 getBuyAmount()
      Value of the buyAmount field.
      Returns:
      the buyAmount 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
    • setBuyAmount

      public void setBuyAmount(Int64 buyAmount)
      Value of the buyAmount field.
      Parameters:
      buyAmount - the buyAmount 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