Class HookCreationDetails

java.lang.Object
com.hedera.hashgraph.sdk.HookCreationDetails

public class HookCreationDetails extends Object
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 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 hook
      hookId - the ID to create the hook at
      hook - the hook implementation
      adminKey - the admin key for managing the hook
    • HookCreationDetails

      public HookCreationDetails(HookExtensionPoint extensionPoint, long hookId, EvmHook hook)
      Create new hook creation details without an admin key.
      Parameters:
      extensionPoint - the extension point for the hook
      hookId - the ID to create the hook at
      hook - the hook implementation
  • Method Details

    • getExtensionPoint

      public HookExtensionPoint 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

      public EvmHook getHook()
      Get the hook implementation.
      Returns:
      the hook implementation
    • getAdminKey

      @Nullable public Key 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

      public static HookCreationDetails fromProtobuf(HookCreationDetails proto)
      Create HookCreationDetails from a protobuf message.
      Parameters:
      proto - the protobuf HookCreationDetails
      Returns:
      a new HookCreationDetails instance
    • 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