Interface GuildSettingsManager<T>

Type Parameters:
T - The specific type of the settings object.

public interface GuildSettingsManager<T>
An implementable frame for classes that handle Guild-Specific settings.

Standard implementations should be able to simply provide a type of Object provided a non-null Guild. Further customization of the implementation is allowed on the developer end.

Since:
2.0
Author:
Kaidan Gustave
Implementation Note:
Unless in the event of a major breaking change to JDA, there is no chance of implementations of this interface being required to implement additional methods.
If in the future it is decided to add a method to this interface, the method will have a default implementation that doesn't require developer additions.
  • Method Summary

    Modifier and Type
    Method
    Description
    getSettings(net.dv8tion.jda.api.entities.Guild guild)
    Gets settings for a specified Guild as an object of the specified type T, or null if the guild has no settings.
    default void
    Called when JDA has fired a ReadyEvent.
    default void
    Called when JDA has fired a ShutdownEvent.
  • Method Details

    • getSettings

      @Nullable T getSettings(net.dv8tion.jda.api.entities.Guild guild)
      Gets settings for a specified Guild as an object of the specified type T, or null if the guild has no settings.
      Parameters:
      guild - The guild to get settings for.
      Returns:
      The settings object for the guild, or null if the guild has no settings.
    • init

      default void init()
      Called when JDA has fired a ReadyEvent.

      Developers should implement this method to create or initialize resources when starting their bot.

    • shutdown

      default void shutdown()
      Called when JDA has fired a ShutdownEvent.

      Developers should implement this method to free up or close resources when shutting their bot.