Enum Class SCErrorCode

java.lang.Object
java.lang.Enum<SCErrorCode>
org.stellar.sdk.xdr.SCErrorCode
All Implemented Interfaces:
Serializable, Comparable<SCErrorCode>, Constable, XdrElement

public enum SCErrorCode extends Enum<SCErrorCode> implements XdrElement
SCErrorCode's original definition in the XDR file is:
 enum SCErrorCode
 {
     SCEC_ARITH_DOMAIN = 0,      // Some arithmetic was undefined (overflow, divide-by-zero).
     SCEC_INDEX_BOUNDS = 1,      // Something was indexed beyond its bounds.
     SCEC_INVALID_INPUT = 2,     // User provided some otherwise-bad data.
     SCEC_MISSING_VALUE = 3,     // Some value was required but not provided.
     SCEC_EXISTING_VALUE = 4,    // Some value was provided where not allowed.
     SCEC_EXCEEDED_LIMIT = 5,    // Some arbitrary limit -- gas or otherwise -- was hit.
     SCEC_INVALID_ACTION = 6,    // Data was valid but action requested was not.
     SCEC_INTERNAL_ERROR = 7,    // The host detected an error in its own logic.
     SCEC_UNEXPECTED_TYPE = 8,   // Some type wasn't as expected.
     SCEC_UNEXPECTED_SIZE = 9    // Something's size wasn't as expected.
 };
 
  • Enum Constant Details

    • SCEC_ARITH_DOMAIN

      public static final SCErrorCode SCEC_ARITH_DOMAIN
    • SCEC_INDEX_BOUNDS

      public static final SCErrorCode SCEC_INDEX_BOUNDS
    • SCEC_INVALID_INPUT

      public static final SCErrorCode SCEC_INVALID_INPUT
    • SCEC_MISSING_VALUE

      public static final SCErrorCode SCEC_MISSING_VALUE
    • SCEC_EXISTING_VALUE

      public static final SCErrorCode SCEC_EXISTING_VALUE
    • SCEC_EXCEEDED_LIMIT

      public static final SCErrorCode SCEC_EXCEEDED_LIMIT
    • SCEC_INVALID_ACTION

      public static final SCErrorCode SCEC_INVALID_ACTION
    • SCEC_INTERNAL_ERROR

      public static final SCErrorCode SCEC_INTERNAL_ERROR
    • SCEC_UNEXPECTED_TYPE

      public static final SCErrorCode SCEC_UNEXPECTED_TYPE
    • SCEC_UNEXPECTED_SIZE

      public static final SCErrorCode SCEC_UNEXPECTED_SIZE
  • Method Details

    • values

      public static SCErrorCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SCErrorCode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
    • decode

      public static SCErrorCode decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

      public static SCErrorCode decode(XdrDataInputStream stream) throws IOException
      Throws:
      IOException
    • 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
    • fromXdrBase64

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

      public static SCErrorCode 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 SCErrorCode fromJson(String json)