Class SpigotApplicationBuilder

java.lang.Object
io.github.slimjar.app.builder.ApplicationBuilder<SpigotApplicationBuilder>
io.github.slimjar.app.builder.SpigotApplicationBuilder

public final class SpigotApplicationBuilder extends io.github.slimjar.app.builder.ApplicationBuilder<SpigotApplicationBuilder>
A builder class for creating and configuring a Spigot-based application.

The SpigotApplicationBuilder provides methods for customizing the behavior of the application, such as enabling debug mode, configuring dependency remapping, and injecting dependencies into the application. This builder is specifically designed to work in the context of a Spigot plugin environment, utilizing plugin-specific resources such as the logger, class loader, and data folder.

The builder ensures that dependencies are properly loaded and optionally remapped, enabling advanced use cases like dependency isolation or custom dependency management for Spigot plugins.

This class is immutable and can only be configured through fluent methods. Once configuration is complete, calling ApplicationBuilder.build() will create and return the configured application instance.

  • Field Summary

    Fields inherited from class io.github.slimjar.app.builder.ApplicationBuilder

    self
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpigotApplicationBuilder(@NotNull org.bukkit.plugin.Plugin plugin)
    Constructs a new instance of SpigotApplicationBuilder for building a Spigot-based application.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @NotNull io.github.slimjar.app.Application
     
    debug(boolean debug)
    Sets the debug mode for the application builder.
    remap(boolean remap)
    Sets the remap mode for the application builder.

    Methods inherited from class io.github.slimjar.app.builder.ApplicationBuilder

    appending, build, createInjector, dataProviderFactory, dependencyFileUrl, downloadDirectoryPath, downloaderFactory, enquirerFactory, getApplicationName, getDataProviderFactory, getDependencyFileUrl, getDownloadDirectoryPath, getDownloaderFactory, getEnquirerFactory, getInjectorFactory, getLogger, getMirrorSelector, getPreResolutionDataProviderFactory, getPreResolutionFileUrl, getRelocationHelperFactory, getRelocatorFactory, getResolverFactory, getVerifierFactory, injecting, injectorFactory, isolated, logger, mirrorSelector, preResolutionDataProviderFactory, preResolutionFileUrl, relocationHelperFactory, relocatorFactory, resolverFactory, verifierFactory

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpigotApplicationBuilder

      public SpigotApplicationBuilder(@NotNull @NotNull org.bukkit.plugin.Plugin plugin)
      Constructs a new instance of SpigotApplicationBuilder for building a Spigot-based application. This constructor initializes the application builder with plugin-specific configurations such as the name, class loader, logger, and download directory for dependency management.
      Parameters:
      plugin - an instance of Plugin representing the Spigot plugin. This plugin provides the necessary context, such as its name, logger, class loader, and data folder, for configuring the application builder.
  • Method Details

    • debug

      @Contract(value="_ -> this", mutates="this") public SpigotApplicationBuilder debug(boolean debug)
      Sets the debug mode for the application builder. Ignored when a custom process logger is used
      Parameters:
      debug - a boolean indicating whether debug logging should be enabled (true) or disabled (false)
      Returns:
      the current instance of SpigotApplicationBuilder for method chaining
    • remap

      @Contract(value="_ -> this", mutates="this") public SpigotApplicationBuilder remap(boolean remap)
      Sets the remap mode for the application builder.
      Parameters:
      remap - a boolean indicating whether remapping should be enabled (true) or disabled (false)
      Returns:
      the current instance of SpigotApplicationBuilder for method chaining
    • buildApplication

      @NotNull protected @NotNull io.github.slimjar.app.Application buildApplication()
      Specified by:
      buildApplication in class io.github.slimjar.app.builder.ApplicationBuilder<SpigotApplicationBuilder>