Package ch.grengine.sources
Class CompositeSources.Builder
java.lang.Object
ch.grengine.sources.CompositeSources.Builder
- Enclosing class:
- CompositeSources
Builder for instances of
CompositeSources.- Since:
- 1.0
- Author:
- Alain Stalder, Made in Switzerland.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longthe default latency (5000ms = five seconds). -
Constructor Summary
ConstructorsConstructorDescriptionBuilder(Collection<Sources> sourcesCollection) constructor from a collection of sources. -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds a new instance ofCompositeSources.gets the compiler factory.longgets the latency in milliseconds.getName()gets the sources name.gets the collection of sources.setCompilerFactory(CompilerFactory compilerFactory) sets the compiler factory for compiling sources, default is a new instance ofDefaultGroovyCompilerFactory.setLatencyMs(long latencyMs) sets the latency in milliseconds for checking if script files in the directory have changed, default isDEFAULT_LATENCY_MS.sets the sources name, default is a generated random ID.
-
Field Details
-
DEFAULT_LATENCY_MS
public static final long DEFAULT_LATENCY_MSthe default latency (5000ms = five seconds).- Since:
- 1.0
- See Also:
-
-
Constructor Details
-
Builder
constructor from a collection of sources.- Parameters:
sourcesCollection- collection of sources- Throws:
NullPointerException- if the sources collection is null- Since:
- 1.0
-
-
Method Details
-
setName
sets the sources name, default is a generated random ID.- Parameters:
name- sources name- Returns:
- this, for chaining calls
- Throws:
IllegalStateException- if the builder had already been used to build an instance- Since:
- 1.0
-
setCompilerFactory
sets the compiler factory for compiling sources, default is a new instance ofDefaultGroovyCompilerFactory.- Parameters:
compilerFactory- compiler factory- Returns:
- this, for chaining calls
- Throws:
IllegalStateException- if the builder had already been used to build an instance- Since:
- 1.0
-
setLatencyMs
sets the latency in milliseconds for checking if script files in the directory have changed, default isDEFAULT_LATENCY_MS.- Parameters:
latencyMs- latency in milliseconds- Returns:
- this, for chaining calls
- Throws:
IllegalStateException- if the builder had already been used to build an instance- Since:
- 1.0
-
getSourcesCollection
gets the collection of sources.- Returns:
- collection of sources
- Since:
- 1.0
-
getName
gets the sources name.- Returns:
- sources name
- Since:
- 1.0
-
getCompilerFactory
gets the compiler factory.- Returns:
- compiler factory
- Since:
- 1.0
-
getLatencyMs
public long getLatencyMs()gets the latency in milliseconds.- Returns:
- latency in milliseconds
- Since:
- 1.0
-
build
builds a new instance ofCompositeSources.- Returns:
- new instance
- Since:
- 1.0
-