Class AccountEntry

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

public class AccountEntry extends Object implements XdrElement
AccountEntry's original definition in the XDR file is:
 struct AccountEntry
 {
     AccountID accountID;      // master public key for this account
     int64 balance;            // in stroops
     SequenceNumber seqNum;    // last sequence number used for this account
     uint32 numSubEntries;     // number of sub-entries this account has
                               // drives the reserve
     AccountID* inflationDest; // Account to vote for during inflation
     uint32 flags;             // see AccountFlags

     string32 homeDomain; // can be used for reverse federation and memo lookup

     // fields used for signatures
     // thresholds stores unsigned bytes: [weight of master|low|medium|high]
     Thresholds thresholds;

     Signer signers<MAX_SIGNERS>; // possible signers for this account

     // reserved for future use
     union switch (int v)
     {
     case 0:
         void;
     case 1:
         AccountEntryExtensionV1 v1;
     }
     ext;
 };
 
  • Constructor Details

    • AccountEntry

      public AccountEntry()
    • AccountEntry

      public AccountEntry(AccountID accountID, Int64 balance, SequenceNumber seqNum, Uint32 numSubEntries, AccountID inflationDest, Uint32 flags, String32 homeDomain, Thresholds thresholds, Signer[] signers, AccountEntry.AccountEntryExt ext)
      Creates a new AccountEntry instance.
      Parameters:
      accountID - the accountID field value
      balance - the balance field value
      seqNum - the seqNum field value
      numSubEntries - the numSubEntries field value
      inflationDest - the inflationDest field value
      flags - the flags field value
      homeDomain - the homeDomain field value
      thresholds - the thresholds field value
      signers - the signers field value
      ext - the ext 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 AccountEntry decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

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

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

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

      public static AccountEntry.AccountEntryBuilder builder()
    • toBuilder

    • getAccountID

      public AccountID getAccountID()
      Value of the accountID field.
      Returns:
      the accountID field value
    • getBalance

      public Int64 getBalance()
      Value of the balance field.
      Returns:
      the balance field value
    • getSeqNum

      public SequenceNumber getSeqNum()
      Value of the seqNum field.
      Returns:
      the seqNum field value
    • getNumSubEntries

      public Uint32 getNumSubEntries()
      Value of the numSubEntries field.
      Returns:
      the numSubEntries field value
    • getInflationDest

      public AccountID getInflationDest()
      Value of the inflationDest field.
      Returns:
      the inflationDest field value
    • getFlags

      public Uint32 getFlags()
      Value of the flags field.
      Returns:
      the flags field value
    • getHomeDomain

      public String32 getHomeDomain()
      Value of the homeDomain field.
      Returns:
      the homeDomain field value
    • getThresholds

      public Thresholds getThresholds()
      Value of the thresholds field.
      Returns:
      the thresholds field value
    • getSigners

      public Signer[] getSigners()
      Value of the signers field.
      Returns:
      the signers field value
    • getExt

      Value of the ext field.
      Returns:
      the ext field value
    • setAccountID

      public void setAccountID(AccountID accountID)
      Value of the accountID field.
      Parameters:
      accountID - the accountID field value
    • setBalance

      public void setBalance(Int64 balance)
      Value of the balance field.
      Parameters:
      balance - the balance field value
    • setSeqNum

      public void setSeqNum(SequenceNumber seqNum)
      Value of the seqNum field.
      Parameters:
      seqNum - the seqNum field value
    • setNumSubEntries

      public void setNumSubEntries(Uint32 numSubEntries)
      Value of the numSubEntries field.
      Parameters:
      numSubEntries - the numSubEntries field value
    • setInflationDest

      public void setInflationDest(AccountID inflationDest)
      Value of the inflationDest field.
      Parameters:
      inflationDest - the inflationDest field value
    • setFlags

      public void setFlags(Uint32 flags)
      Value of the flags field.
      Parameters:
      flags - the flags field value
    • setHomeDomain

      public void setHomeDomain(String32 homeDomain)
      Value of the homeDomain field.
      Parameters:
      homeDomain - the homeDomain field value
    • setThresholds

      public void setThresholds(Thresholds thresholds)
      Value of the thresholds field.
      Parameters:
      thresholds - the thresholds field value
    • setSigners

      public void setSigners(Signer[] signers)
      Value of the signers field.
      Parameters:
      signers - the signers field value
    • setExt

      public void setExt(AccountEntry.AccountEntryExt ext)
      Value of the ext field.
      Parameters:
      ext - the ext 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