Class ModuleContentLedgers
java.lang.Object
com.ultikits.ultitools.utils.ModuleContentLedgers
Holds the ledger that answers custom content queries.
- Since:
- 7.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleContentAsks the installed ledger.static ModuleContentLedgercurrent()Returns the installed ledger,ModuleContentLedger.NONEuntil one is installed.static voidinstall(ModuleContentLedger ledger) Installs the ledger; the bootstrap content channels call this once per start.
-
Field Details
-
ledger
-
-
Constructor Details
-
ModuleContentLedgers
private ModuleContentLedgers()
-
-
Method Details
-
current
Returns the installed ledger,ModuleContentLedger.NONEuntil one is installed.- Returns:
- the installed ledger
-
install
Installs the ledger; the bootstrap content channels call this once per start. InstallingModuleContentLedger.NONErestores the default (tests use this to clean up).- Parameters:
ledger- the ledger to install- Throws:
NullPointerException- ifledgerisnull
-
contentOf
Asks the installed ledger. A runtime exception ornullresult is answered withModuleContent.unknown()so that a removal still warns. Errors propagate.- Parameters:
identifyString- the module's normalised identify string, ornullwhen unknownmoduleName- thenamefrom the module'splugin.yml; the primary lookup key- Returns:
- the content, or unknown content if the ledger fails
- Throws:
NullPointerException- ifmoduleNameisnull
-