Class BucketEntry

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

public class BucketEntry extends Object implements XdrElement
BucketEntry's original definition in the XDR file is:
 union BucketEntry switch (BucketEntryType type)
 {
 case LIVEENTRY:
 case INITENTRY:
     LedgerEntry liveEntry;

 case DEADENTRY:
     LedgerKey deadEntry;
 case METAENTRY:
     BucketMetadata metaEntry;
 };
 
  • Constructor Details

    • BucketEntry

      public BucketEntry()
    • BucketEntry

      public BucketEntry(BucketEntryType discriminant, LedgerEntry liveEntry, LedgerKey deadEntry, BucketMetadata metaEntry)
      Creates a new BucketEntry instance.
      Parameters:
      discriminant - the discriminant field value
      liveEntry - the liveEntry field value
      deadEntry - the deadEntry field value
      metaEntry - the metaEntry 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 BucketEntry decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

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

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

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

      public static BucketEntry.BucketEntryBuilder builder()
    • toBuilder

      public BucketEntry.BucketEntryBuilder toBuilder()
    • getDiscriminant

      public BucketEntryType getDiscriminant()
      Value of the discriminant field.
      Returns:
      the discriminant field value
    • getLiveEntry

      public LedgerEntry getLiveEntry()
      Value of the liveEntry field.
      Returns:
      the liveEntry field value
    • getDeadEntry

      public LedgerKey getDeadEntry()
      Value of the deadEntry field.
      Returns:
      the deadEntry field value
    • getMetaEntry

      public BucketMetadata getMetaEntry()
      Value of the metaEntry field.
      Returns:
      the metaEntry field value
    • setDiscriminant

      public void setDiscriminant(BucketEntryType discriminant)
      Value of the discriminant field.
      Parameters:
      discriminant - the discriminant field value
    • setLiveEntry

      public void setLiveEntry(LedgerEntry liveEntry)
      Value of the liveEntry field.
      Parameters:
      liveEntry - the liveEntry field value
    • setDeadEntry

      public void setDeadEntry(LedgerKey deadEntry)
      Value of the deadEntry field.
      Parameters:
      deadEntry - the deadEntry field value
    • setMetaEntry

      public void setMetaEntry(BucketMetadata metaEntry)
      Value of the metaEntry field.
      Parameters:
      metaEntry - the metaEntry 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