mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-17 12:39:12 +03:00
24 lines
815 B
Java
24 lines
815 B
Java
|
package pro.gravit.launcher.modules;
|
||
|
|
||
|
import pro.gravit.utils.Version;
|
||
|
|
||
|
import java.util.function.Predicate;
|
||
|
|
||
|
public interface LauncherModulesManager {
|
||
|
LauncherModule loadModule(LauncherModule module);
|
||
|
LauncherModule getModule(String name);
|
||
|
default boolean containsModule(String name)
|
||
|
{
|
||
|
return getModule(name) != null;
|
||
|
}
|
||
|
|
||
|
default <T extends LauncherModule> boolean containsModule(Class<? extends T> clazz)
|
||
|
{
|
||
|
return getModule(clazz) != null;
|
||
|
}
|
||
|
ClassLoader getModuleClassLoader();
|
||
|
<T extends LauncherModule> T getModule(Class<? extends T> clazz);
|
||
|
<T extends LauncherModule> T findModule(Class<? extends T> clazz, Predicate<Version> versionPredicate);
|
||
|
<T extends LauncherModule.Event> LauncherModule.EventAction invokeEvent(T event) throws Exception;
|
||
|
}
|