Class ModuleIds

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

@Internal public final class ModuleIds extends Object
The one derivation of a module's UltiCloud identifier; internal, not for module use.

UltiCloud addresses a module by its catalogue identifier: the <id> a hello declares in modules:<id>@X.Y.Z, the module of a module.request, the moduleName of an error.report and the :moduleRef of every catalogue route must all be that identifier, lower-case, in the contract's ModuleIdentifier syntax (a lower-case letter first, segments of lower-case letters and digits joined by a single . or -, at most 64 characters). The framework derives it from the module's identify-string, never from its plugin.yml name: the two differ for some modules (for example name UltiTools-Chat, identify-string ultichat), and the name is free text the server does not match.

Since:
6.3.1
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The contract's bound on a module identifier.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    A loaded module's identifier, from its identify-string.
    static String
    of(String identifyString)
    A module's identifier from its identify-string: trimmed and lower-cased; null when the result is empty, longer than MAX_LENGTH or not in the contract's identifier syntax.

    Methods inherited from class java.lang.Object

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

    • MAX_LENGTH

      public static final int MAX_LENGTH
      The contract's bound on a module identifier.
      See Also:
  • Constructor Details

    • ModuleIds

      private ModuleIds()
  • Method Details

    • of

      public static String of(String identifyString)
      A module's identifier from its identify-string: trimmed and lower-cased; null when the result is empty, longer than MAX_LENGTH or not in the contract's identifier syntax.
      Parameters:
      identifyString - an identify-string, possibly null
      Returns:
      the identifier, or null when it cannot be one
    • of

      public static String of(UltiToolsPlugin module)
      A loaded module's identifier, from its identify-string.
      Parameters:
      module - the module, possibly null
      Returns:
      the identifier, or null when there is no module or its identify-string cannot be one