Class NameOrModule

java.lang.Object
com.calebleavell.jatui.modules.NameOrModule

public final class NameOrModule extends Object
Stores either the module builder or the name of a module, which abstracts module retrieving. See usage in NumberedModuleSelector
  • Constructor Details

    • NameOrModule

      public NameOrModule(TUIModule.Builder<?> module)
      Sets the stored module to a concrete reference to a builder.
      Parameters:
      module - The module to remember.
    • NameOrModule

      public NameOrModule(String moduleName)
      Sets the stored module to the name of a builder.
      Parameters:
      moduleName - The name of the module to remember.
  • Method Details

    • getModule

      public TUIModule.Builder<?> getModule(ApplicationModule app)
      Fetches the module that was inputted from either the concrete reference or the name. Requires the possible names to be a child of app.
      Parameters:
      app - The app that a potential name of the module would be a child of.
      Returns:
      The remembered module.
    • getCopy

      public NameOrModule getCopy()
      Creates a new instance of this NameOrModule object that remembers a copy of the module if a concrete reference was stored, or the same name if only the name was stored.
      Returns:
      The new copy of this instance.