Class ExecutablesPluginLoader

java.lang.Object
net.regsirius06.engine.plugins.loaders.DefaultPluginLoader<Executable>
net.regsirius06.engine.plugins.loaders.ExecutablesPluginLoader
All Implemented Interfaces:
PluginLoader<Executable>

public final class ExecutablesPluginLoader extends DefaultPluginLoader<Executable>
A PluginLoader implementation for loading Executable plugins. This class loads executable plugins for a specific core type and provides additional functionality to filter and retrieve a special "About" executable.

It extends the DefaultPluginLoader to handle the loading of plugins of type Executable and offers methods to retrieve all executables as well as a specific "About" executable if available.

  • Constructor Details

    • ExecutablesPluginLoader

      public ExecutablesPluginLoader(@NotNull @NotNull Class<? extends Core> type)
      Constructs a new ExecutablesPluginLoader for the given core type.

      This constructor initializes the loader and automatically loads the executables using the DefaultPluginLoader.loadPlugins() method.

      Parameters:
      type - the core type to associate with the loader
  • Method Details

    • getPlugins

      public List<Executable> getPlugins()
      Returns a list of all executable plugins, excluding the one with the name "About".

      The "About" executable is excluded from this list as it serves a specific purpose (typically displaying information about the plugin or application).

      Specified by:
      getPlugins in interface PluginLoader<Executable>
      Overrides:
      getPlugins in class DefaultPluginLoader<Executable>
      Returns:
      a list of executable plugins, excluding the "About" executable
    • getAbout

      @Nullable public @Nullable Executable getAbout()
      Retrieves the "About" executable plugin, if available.

      This method returns the first plugin whose name is "About". If no such plugin is found, it returns null.

      Returns:
      the "About" executable plugin, or null if not found