Class PluginInstallUtils.InstallResult

java.lang.Object
com.ultikits.ultitools.utils.PluginInstallUtils.InstallResult
Enclosing class:
PluginInstallUtils

@Internal public static final class PluginInstallUtils.InstallResult extends Object
What PluginInstallUtils.installReporting(String, String) did. The reason strings are i18n keys (Chinese, with their English values in lang/en.json), formatted with getReasonArgs().
  • Field Details

    • installed

      private final boolean installed
    • fileName

      private final String fileName
    • reasonKey

      private final String reasonKey
    • reasonArgs

      private final Object[] reasonArgs
  • Constructor Details

    • InstallResult

      private InstallResult(boolean installed, String fileName, String reasonKey, Object[] reasonArgs)
  • Method Details

    • installed

      public static PluginInstallUtils.InstallResult installed(String fileName)
      Parameters:
      fileName - the file written into the modules folder
      Returns:
      an install that succeeded
    • failed

      public static PluginInstallUtils.InstallResult failed()
      Returns:
      a failure with no reason to report beyond "install failed"
    • refused

      public static PluginInstallUtils.InstallResult refused(String reasonKey, Object... reasonArgs)
      Parameters:
      reasonKey - one of the PluginInstallUtils.InstallResult.Keys reasons
      reasonArgs - its arguments
      Returns:
      a refusal with its reason
    • isInstalled

      public boolean isInstalled()
      Returns:
      whether the module was installed
    • getFileName

      public String getFileName()
      Returns:
      the file written into the modules folder, or null
    • getReasonKey

      public String getReasonKey()
      Returns:
      the reason's i18n key, or null
    • getReasonArgs

      public Object[] getReasonArgs()
      Returns:
      the reason's arguments, empty when there is no reason