Package org.stellar.sdk.xdr
Class SorobanAuthorizedFunction
java.lang.Object
org.stellar.sdk.xdr.SorobanAuthorizedFunction
- All Implemented Interfaces:
XdrElement
SorobanAuthorizedFunction's original definition in the XDR file is:
union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type)
{
case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN:
InvokeContractArgs contractFn;
// This variant of auth payload for creating new contract instances
// doesn't allow specifying the constructor arguments, creating contracts
// with constructors that take arguments is only possible by authorizing
// `SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN`
// (protocol 22+).
case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN:
CreateContractArgs createContractHostFn;
// This variant of auth payload for creating new contract instances
// is only accepted in and after protocol 22. It allows authorizing the
// contract constructor arguments.
case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN:
CreateContractArgsV2 createContractV2HostFn;
};
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionSorobanAuthorizedFunction(SorobanAuthorizedFunctionType discriminant, InvokeContractArgs contractFn, CreateContractArgs createContractHostFn, CreateContractArgsV2 createContractV2HostFn) Creates a newSorobanAuthorizedFunctioninstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static SorobanAuthorizedFunctiondecode(XdrDataInputStream stream) static SorobanAuthorizedFunctiondecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic SorobanAuthorizedFunctionstatic SorobanAuthorizedFunctionfromXdrBase64(String xdr) static SorobanAuthorizedFunctionfromXdrByteArray(byte[] xdr) Value of thecontractFnfield.Value of thecreateContractHostFnfield.Value of thecreateContractV2HostFnfield.Value of thediscriminantfield.inthashCode()voidsetContractFn(InvokeContractArgs contractFn) Value of thecontractFnfield.voidsetCreateContractHostFn(CreateContractArgs createContractHostFn) Value of thecreateContractHostFnfield.voidsetCreateContractV2HostFn(CreateContractArgsV2 createContractV2HostFn) Value of thecreateContractV2HostFnfield.voidsetDiscriminant(SorobanAuthorizedFunctionType discriminant) Value of thediscriminantfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
SorobanAuthorizedFunction
public SorobanAuthorizedFunction() -
SorobanAuthorizedFunction
public SorobanAuthorizedFunction(SorobanAuthorizedFunctionType discriminant, InvokeContractArgs contractFn, CreateContractArgs createContractHostFn, CreateContractArgsV2 createContractV2HostFn) Creates a newSorobanAuthorizedFunctioninstance.- Parameters:
discriminant- thediscriminantfield valuecontractFn- thecontractFnfield valuecreateContractHostFn- thecreateContractHostFnfield valuecreateContractV2HostFn- thecreateContractV2HostFnfield 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
public static SorobanAuthorizedFunction decode(XdrDataInputStream stream, int maxDepth) throws IOException - 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
-
getContractFn
Value of thecontractFnfield.- Returns:
- the
contractFnfield value
-
getCreateContractHostFn
Value of thecreateContractHostFnfield.- Returns:
- the
createContractHostFnfield value
-
getCreateContractV2HostFn
Value of thecreateContractV2HostFnfield.- Returns:
- the
createContractV2HostFnfield value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setContractFn
Value of thecontractFnfield.- Parameters:
contractFn- thecontractFnfield value
-
setCreateContractHostFn
Value of thecreateContractHostFnfield.- Parameters:
createContractHostFn- thecreateContractHostFnfield value
-
setCreateContractV2HostFn
Value of thecreateContractV2HostFnfield.- Parameters:
createContractV2HostFn- thecreateContractV2HostFnfield value
-
equals
-
hashCode
public int hashCode() -
toString
-