java.lang.Object
com.hedera.hashgraph.sdk.HookCreationDetails
Specifies the details of a hook's creation.
This class contains all the information needed to create a new hook, including the extension point, hook ID, implementation, and optional admin key.
-
Constructor Summary
ConstructorsConstructorDescriptionHookCreationDetails(HookExtensionPoint extensionPoint, long hookId, EvmHook hook) Create new hook creation details without an admin key.HookCreationDetails(HookExtensionPoint extensionPoint, long hookId, EvmHook hook, Key adminKey) Create new hook creation details with an admin key. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic HookCreationDetailsfromProtobuf(HookCreationDetails proto) Create HookCreationDetails from a protobuf message.Get the admin key for this hook.Get the extension point for this hook.getHook()Get the hook implementation.longGet the ID to create the hook at.booleanCheck if this hook has an admin key.inthashCode()(package private) HookCreationDetailsConvert this HookCreationDetails to a protobuf message.toString()
-
Constructor Details
-
HookCreationDetails
public HookCreationDetails(HookExtensionPoint extensionPoint, long hookId, EvmHook hook, @Nullable Key adminKey) Create new hook creation details with an admin key.- Parameters:
extensionPoint- the extension point for the hookhookId- the ID to create the hook athook- the hook implementationadminKey- the admin key for managing the hook
-
HookCreationDetails
Create new hook creation details without an admin key.- Parameters:
extensionPoint- the extension point for the hookhookId- the ID to create the hook athook- the hook implementation
-
-
Method Details
-
getExtensionPoint
Get the extension point for this hook.- Returns:
- the extension point
-
getHookId
public long getHookId()Get the ID to create the hook at.- Returns:
- the hook ID
-
getHook
Get the hook implementation.- Returns:
- the hook implementation
-
getAdminKey
Get the admin key for this hook.- Returns:
- the admin key, or null if not set
-
hasAdminKey
public boolean hasAdminKey()Check if this hook has an admin key.- Returns:
- true if an admin key is set, false otherwise
-
toProtobuf
HookCreationDetails toProtobuf()Convert this HookCreationDetails to a protobuf message.- Returns:
- the protobuf HookCreationDetails
-
fromProtobuf
Create HookCreationDetails from a protobuf message.- Parameters:
proto- the protobuf HookCreationDetails- Returns:
- a new HookCreationDetails instance
-
equals
-
hashCode
public int hashCode() -
toString
-