Class ModuleContentLedgers

java.lang.Object
com.ultikits.ultitools.utils.ModuleContentLedgers

@Internal public final class ModuleContentLedgers extends Object
Holds the ledger that answers custom content queries.
Since:
7.0.0
  • Field Details

  • Constructor Details

    • ModuleContentLedgers

      private ModuleContentLedgers()
  • Method Details

    • current

      public static ModuleContentLedger current()
      Returns the installed ledger, ModuleContentLedger.NONE until one is installed.
      Returns:
      the installed ledger
    • install

      public static void install(ModuleContentLedger ledger)
      Installs the ledger; the bootstrap content channels call this once per start. Installing ModuleContentLedger.NONE restores the default (tests use this to clean up).
      Parameters:
      ledger - the ledger to install
      Throws:
      NullPointerException - if ledger is null
    • contentOf

      public static ModuleContent contentOf(@Nullable @Nullable String identifyString, String moduleName)
      Asks the installed ledger. A runtime exception or null result is answered with ModuleContent.unknown() so that a removal still warns. Errors propagate.
      Parameters:
      identifyString - the module's normalised identify string, or null when unknown
      moduleName - the name from the module's plugin.yml; the primary lookup key
      Returns:
      the content, or unknown content if the ledger fails
      Throws:
      NullPointerException - if moduleName is null