Package fr.flowarg.flowupdater.utils
Class UpdaterOptions.UpdaterOptionsBuilder
java.lang.Object
fr.flowarg.flowupdater.utils.UpdaterOptions.UpdaterOptionsBuilder
- All Implemented Interfaces:
IBuilder<UpdaterOptions>
- Enclosing class:
- UpdaterOptions
public static class UpdaterOptions.UpdaterOptionsBuilder
extends Object
implements IBuilder<UpdaterOptions>
Builder of
UpdaterOptions-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build anUpdaterOptionsobject.withDisableExtFilesAsyncDownload(boolean disableExtFilesAsyncDownload) Disable asynchronous downloading of external files.withExternalFileDeleter(ExternalFileDeleter externalFileDeleter) Append anExternalFileDeleterobject.withJavaPath(String javaPath) Set the path to the java executable to use with Forge and Fabric installers.withVersionChecker(boolean versionChecker) Enable or disable the version checker.
-
Constructor Details
-
UpdaterOptionsBuilder
public UpdaterOptionsBuilder()
-
-
Method Details
-
withExternalFileDeleter
public UpdaterOptions.UpdaterOptionsBuilder withExternalFileDeleter(ExternalFileDeleter externalFileDeleter) Append anExternalFileDeleterobject.- Parameters:
externalFileDeleter- the file deleter to define.- Returns:
- the builder.
-
withVersionChecker
Enable or disable the version checker.- Parameters:
versionChecker- the value to define.- Returns:
- the builder.
-
withJavaPath
Set the path to the java executable to use with Forge and Fabric installers. (Directly the java executable, not the java home) If you wish to set up the java home, you should use theSystem.setProperty(String, String)method with the "java.home" key. By default, it's taken fromSystem.getProperty("java.home").- Parameters:
javaPath- the path to the java executable.- Returns:
- the builder.
-
withDisableExtFilesAsyncDownload
public UpdaterOptions.UpdaterOptionsBuilder withDisableExtFilesAsyncDownload(boolean disableExtFilesAsyncDownload) Disable asynchronous downloading of external files. SeeUpdaterOptions.shouldDisableExtFilesAsyncDownload()for more information.- Parameters:
disableExtFilesAsyncDownload- true to disable asynchronous downloading of external files. False otherwise.- Returns:
- the builder.
-
build
Build anUpdaterOptionsobject.- Specified by:
buildin interfaceIBuilder<UpdaterOptions>- Returns:
- a
IBuilderobject. - Throws:
BuilderException- if an error occurred when building an object.
-