Class SCError

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

public class SCError extends Object implements XdrElement
SCError's original definition in the XDR file is:
 union SCError switch (SCErrorType type)
 {
 case SCE_CONTRACT:
     uint32 contractCode;
 case SCE_WASM_VM:
 case SCE_CONTEXT:
 case SCE_STORAGE:
 case SCE_OBJECT:
 case SCE_CRYPTO:
 case SCE_EVENTS:
 case SCE_BUDGET:
 case SCE_VALUE:
 case SCE_AUTH:
     SCErrorCode code;
 };
 
  • Constructor Details

    • SCError

      public SCError()
    • SCError

      public SCError(SCErrorType discriminant, Uint32 contractCode, SCErrorCode code)
      Creates a new SCError instance.
      Parameters:
      discriminant - the discriminant field value
      contractCode - the contractCode field value
      code - the code 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 SCError decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

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

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

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

      public static SCError.SCErrorBuilder builder()
    • toBuilder

      public SCError.SCErrorBuilder toBuilder()
    • getDiscriminant

      public SCErrorType getDiscriminant()
      Value of the discriminant field.
      Returns:
      the discriminant field value
    • getContractCode

      public Uint32 getContractCode()
      Value of the contractCode field.
      Returns:
      the contractCode field value
    • getCode

      public SCErrorCode getCode()
      Value of the code field.
      Returns:
      the code field value
    • setDiscriminant

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

      public void setContractCode(Uint32 contractCode)
      Value of the contractCode field.
      Parameters:
      contractCode - the contractCode field value
    • setCode

      public void setCode(SCErrorCode code)
      Value of the code field.
      Parameters:
      code - the code 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