Interface EnvironmentSettings.Builder
-
- Enclosing interface:
- EnvironmentSettings
public static interface EnvironmentSettings.BuilderBuildsEnvironmentSettings
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EnvironmentSettingsbuild()Builds a newEnvironmentSettingsinstance.EnvironmentSettings.BuilderinitScript(String path)Defines the init script for the environmentEnvironmentSettings.BuilderloadExecutor(ScriptLoadingExecutor executor)Define the executor service used to setup task to poll scripts for changes and load new scripts.EnvironmentSettings.BuildermergeSettingsFrom(EnvironmentSettings other)Applies the settings from the give instance to this builderEnvironmentSettings.BuilderpollRate(long time, TimeUnit unit)Define how often the script loader should poll scripts for updatesEnvironmentSettings.BuilderrunExecutor(Executor executor)Define the executor used to run scriptsEnvironmentSettings.BuilderwithBindings(BindingsSupplier supplier)Adds a bindings supplier to the settingsEnvironmentSettings.BuilderwithDefaultPackageImport(String packageName)Marks that aPackageshould be imported by default.EnvironmentSettings.BuilderwithDefaultPackageImports(Collection<String> packageNames)Marks thatPackages should be imported by default.EnvironmentSettings.BuilderwithDefaultTypeImport(String type)Marks that aClassshould be imported by default.EnvironmentSettings.BuilderwithDefaultTypeImports(Collection<String> types)Marks thatClasses should be imported by default.
-
-
-
Method Detail
-
mergeSettingsFrom
EnvironmentSettings.Builder mergeSettingsFrom(EnvironmentSettings other)
Applies the settings from the give instance to this builder- Parameters:
other- the other settings- Returns:
- this builder
-
loadExecutor
EnvironmentSettings.Builder loadExecutor(ScriptLoadingExecutor executor)
Define the executor service used to setup task to poll scripts for changes and load new scripts.- Parameters:
executor- the executor- Returns:
- this builder
-
runExecutor
EnvironmentSettings.Builder runExecutor(Executor executor)
Define the executor used to run scripts- Parameters:
executor- the executor- Returns:
- this builder
-
withBindings
EnvironmentSettings.Builder withBindings(BindingsSupplier supplier)
Adds a bindings supplier to the settings- Parameters:
supplier- the bindings supplier- Returns:
- this builder
-
withDefaultPackageImport
EnvironmentSettings.Builder withDefaultPackageImport(String packageName)
Marks that aPackageshould be imported by default.- Parameters:
packageName- the name of the package - seePackage.getName().- Returns:
- this builder
-
withDefaultPackageImports
EnvironmentSettings.Builder withDefaultPackageImports(Collection<String> packageNames)
Marks thatPackages should be imported by default.- Parameters:
packageNames- the package names - seePackage.getName().- Returns:
- this builder
-
withDefaultTypeImport
EnvironmentSettings.Builder withDefaultTypeImport(String type)
Marks that aClassshould be imported by default.- Parameters:
type- the name of the class - seeClass.getName()- Returns:
- this builder
-
withDefaultTypeImports
EnvironmentSettings.Builder withDefaultTypeImports(Collection<String> types)
Marks thatClasses should be imported by default.- Parameters:
types- class names - seeClass.getName()- Returns:
- this builder
-
pollRate
EnvironmentSettings.Builder pollRate(long time, TimeUnit unit)
Define how often the script loader should poll scripts for updates- Parameters:
time- the timeunit- the unit- Returns:
- this builder
-
initScript
EnvironmentSettings.Builder initScript(String path)
Defines the init script for the environment- Parameters:
path- the path- Returns:
- this builder
-
build
EnvironmentSettings build()
Builds a newEnvironmentSettingsinstance.- Returns:
- the resultant environment settings
-
-