Class LedgerUpgrade

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

public class LedgerUpgrade extends Object implements XdrElement
LedgerUpgrade's original definition in the XDR file is:
 union LedgerUpgrade switch (LedgerUpgradeType type)
 {
 case LEDGER_UPGRADE_VERSION:
     uint32 newLedgerVersion; // update ledgerVersion
 case LEDGER_UPGRADE_BASE_FEE:
     uint32 newBaseFee; // update baseFee
 case LEDGER_UPGRADE_MAX_TX_SET_SIZE:
     uint32 newMaxTxSetSize; // update maxTxSetSize
 case LEDGER_UPGRADE_BASE_RESERVE:
     uint32 newBaseReserve; // update baseReserve
 case LEDGER_UPGRADE_FLAGS:
     uint32 newFlags; // update flags
 case LEDGER_UPGRADE_CONFIG:
     // Update arbitrary `ConfigSetting` entries identified by the key.
     ConfigUpgradeSetKey newConfig;
 case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE:
     // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without
     // using `LEDGER_UPGRADE_CONFIG`.
     uint32 newMaxSorobanTxSetSize;
 };
 
  • Constructor Details

    • LedgerUpgrade

      public LedgerUpgrade()
    • LedgerUpgrade

      public LedgerUpgrade(LedgerUpgradeType discriminant, Uint32 newLedgerVersion, Uint32 newBaseFee, Uint32 newMaxTxSetSize, Uint32 newBaseReserve, Uint32 newFlags, ConfigUpgradeSetKey newConfig, Uint32 newMaxSorobanTxSetSize)
      Creates a new LedgerUpgrade instance.
      Parameters:
      discriminant - the discriminant field value
      newLedgerVersion - the newLedgerVersion field value
      newBaseFee - the newBaseFee field value
      newMaxTxSetSize - the newMaxTxSetSize field value
      newBaseReserve - the newBaseReserve field value
      newFlags - the newFlags field value
      newConfig - the newConfig field value
      newMaxSorobanTxSetSize - the newMaxSorobanTxSetSize 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 LedgerUpgrade decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

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

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

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

      public static LedgerUpgrade.LedgerUpgradeBuilder builder()
    • toBuilder

    • getDiscriminant

      public LedgerUpgradeType getDiscriminant()
      Value of the discriminant field.
      Returns:
      the discriminant field value
    • getNewLedgerVersion

      public Uint32 getNewLedgerVersion()
      Value of the newLedgerVersion field.
      Returns:
      the newLedgerVersion field value
    • getNewBaseFee

      public Uint32 getNewBaseFee()
      Value of the newBaseFee field.
      Returns:
      the newBaseFee field value
    • getNewMaxTxSetSize

      public Uint32 getNewMaxTxSetSize()
      Value of the newMaxTxSetSize field.
      Returns:
      the newMaxTxSetSize field value
    • getNewBaseReserve

      public Uint32 getNewBaseReserve()
      Value of the newBaseReserve field.
      Returns:
      the newBaseReserve field value
    • getNewFlags

      public Uint32 getNewFlags()
      Value of the newFlags field.
      Returns:
      the newFlags field value
    • getNewConfig

      public ConfigUpgradeSetKey getNewConfig()
      Value of the newConfig field.
      Returns:
      the newConfig field value
    • getNewMaxSorobanTxSetSize

      public Uint32 getNewMaxSorobanTxSetSize()
      Value of the newMaxSorobanTxSetSize field.
      Returns:
      the newMaxSorobanTxSetSize field value
    • setDiscriminant

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

      public void setNewLedgerVersion(Uint32 newLedgerVersion)
      Value of the newLedgerVersion field.
      Parameters:
      newLedgerVersion - the newLedgerVersion field value
    • setNewBaseFee

      public void setNewBaseFee(Uint32 newBaseFee)
      Value of the newBaseFee field.
      Parameters:
      newBaseFee - the newBaseFee field value
    • setNewMaxTxSetSize

      public void setNewMaxTxSetSize(Uint32 newMaxTxSetSize)
      Value of the newMaxTxSetSize field.
      Parameters:
      newMaxTxSetSize - the newMaxTxSetSize field value
    • setNewBaseReserve

      public void setNewBaseReserve(Uint32 newBaseReserve)
      Value of the newBaseReserve field.
      Parameters:
      newBaseReserve - the newBaseReserve field value
    • setNewFlags

      public void setNewFlags(Uint32 newFlags)
      Value of the newFlags field.
      Parameters:
      newFlags - the newFlags field value
    • setNewConfig

      public void setNewConfig(ConfigUpgradeSetKey newConfig)
      Value of the newConfig field.
      Parameters:
      newConfig - the newConfig field value
    • setNewMaxSorobanTxSetSize

      public void setNewMaxSorobanTxSetSize(Uint32 newMaxSorobanTxSetSize)
      Value of the newMaxSorobanTxSetSize field.
      Parameters:
      newMaxSorobanTxSetSize - the newMaxSorobanTxSetSize 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