Class ClaimOfferAtom

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

public class ClaimOfferAtom extends Object implements XdrElement
ClaimOfferAtom's original definition in the XDR file is:
 struct ClaimOfferAtom
 {
     // emitted to identify the offer
     AccountID sellerID; // Account that owns the offer
     int64 offerID;

     // amount and asset taken from the owner
     Asset assetSold;
     int64 amountSold;

     // amount and asset sent to the owner
     Asset assetBought;
     int64 amountBought;
 };
 
  • Constructor Details

    • ClaimOfferAtom

      public ClaimOfferAtom()
    • ClaimOfferAtom

      public ClaimOfferAtom(AccountID sellerID, Int64 offerID, Asset assetSold, Int64 amountSold, Asset assetBought, Int64 amountBought)
      Creates a new ClaimOfferAtom instance.
      Parameters:
      sellerID - the sellerID field value
      offerID - the offerID field value
      assetSold - the assetSold field value
      amountSold - the amountSold field value
      assetBought - the assetBought field value
      amountBought - the amountBought 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 ClaimOfferAtom decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

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

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

      public static ClaimOfferAtom 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 ClaimOfferAtom fromJson(String json)
    • builder

      public static ClaimOfferAtom.ClaimOfferAtomBuilder builder()
    • toBuilder

    • getSellerID

      public AccountID getSellerID()
      Value of the sellerID field.
      Returns:
      the sellerID field value
    • getOfferID

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

      public Asset getAssetSold()
      Value of the assetSold field.
      Returns:
      the assetSold field value
    • getAmountSold

      public Int64 getAmountSold()
      Value of the amountSold field.
      Returns:
      the amountSold field value
    • getAssetBought

      public Asset getAssetBought()
      Value of the assetBought field.
      Returns:
      the assetBought field value
    • getAmountBought

      public Int64 getAmountBought()
      Value of the amountBought field.
      Returns:
      the amountBought field value
    • setSellerID

      public void setSellerID(AccountID sellerID)
      Value of the sellerID field.
      Parameters:
      sellerID - the sellerID field value
    • setOfferID

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

      public void setAssetSold(Asset assetSold)
      Value of the assetSold field.
      Parameters:
      assetSold - the assetSold field value
    • setAmountSold

      public void setAmountSold(Int64 amountSold)
      Value of the amountSold field.
      Parameters:
      amountSold - the amountSold field value
    • setAssetBought

      public void setAssetBought(Asset assetBought)
      Value of the assetBought field.
      Parameters:
      assetBought - the assetBought field value
    • setAmountBought

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