Package de.themoep.hook.core
Interface Hook<P>
- Type Parameters:
P
- The plugin class which this hook is for
public interface Hook<P>
Represents a hook
-
Method Summary
Modifier and TypeMethodDescriptionThe parent plugin of this hookdefault int
The version of this hook.getName()
Get the name of this hookdefault void
register()
Do some extra registration which this hook might require to work.default void
Do some extra unregistration which this hook might require to be properly cleaned up.
-
Method Details
-
getHooked
P getHooked()The parent plugin of this hook- Returns:
- The parent plugin
-
getName
String getName()Get the name of this hook- Returns:
- The name of this hook; usually the name of the hooked plugin
-
getHookVersion
default int getHookVersion()The version of this hook. This might be useful for some.- Returns:
- The version of this hook; defaults to
0
-
register
default void register()Do some extra registration which this hook might require to work. E.g. registering event listeners -
unregister
default void unregister()Do some extra unregistration which this hook might require to be properly cleaned up. E.g. unregistering event listeners
-