Package org.stellar.sdk.xdr
Class SCError
java.lang.Object
org.stellar.sdk.xdr.SCError
- All Implemented Interfaces:
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;
};
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionSCError()SCError(SCErrorType discriminant, Uint32 contractCode, SCErrorCode code) Creates a newSCErrorinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic SCError.SCErrorBuilderbuilder()static SCErrordecode(XdrDataInputStream stream) static SCErrordecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic SCErrorstatic SCErrorfromXdrBase64(String xdr) static SCErrorfromXdrByteArray(byte[] xdr) getCode()Value of thecodefield.Value of thecontractCodefield.Value of thediscriminantfield.inthashCode()voidsetCode(SCErrorCode code) Value of thecodefield.voidsetContractCode(Uint32 contractCode) Value of thecontractCodefield.voidsetDiscriminant(SCErrorType discriminant) Value of thediscriminantfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
SCError
public SCError() -
SCError
Creates a newSCErrorinstance.- Parameters:
discriminant- thediscriminantfield valuecontractCode- thecontractCodefield valuecode- thecodefield value
-
-
Method Details
-
encode
Description copied from interface:XdrElementEncodes this value to XDR and writes it to the provided stream.- Specified by:
encodein interfaceXdrElement- Parameters:
stream- the destination XDR output stream- Throws:
IOException- if an I/O error occurs while writing the value
-
decode
- Throws:
IOException
-
decode
- Throws:
IOException
-
fromXdrBase64
- Throws:
IOException
-
fromXdrByteArray
- Throws:
IOException
-
toJson
Description copied from interface:XdrElementSerializes this value to JSON.- Specified by:
toJsonin interfaceXdrElement- Returns:
- the JSON representation of this value
-
fromJson
-
builder
-
toBuilder
-
getDiscriminant
Value of thediscriminantfield.- Returns:
- the
discriminantfield value
-
getContractCode
Value of thecontractCodefield.- Returns:
- the
contractCodefield value
-
getCode
Value of thecodefield.- Returns:
- the
codefield value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setContractCode
Value of thecontractCodefield.- Parameters:
contractCode- thecontractCodefield value
-
setCode
Value of thecodefield.- Parameters:
code- thecodefield value
-
equals
-
hashCode
public int hashCode() -
toString
-