Class FixedSetSources.Builder

java.lang.Object
ch.grengine.sources.FixedSetSources.Builder
Enclosing class:
FixedSetSources

public static class FixedSetSources.Builder extends Object
Builder for instances of FixedSetSources.
Since:
1.0
Author:
Alain Stalder, Made in Switzerland.
  • Field Details

    • DEFAULT_LATENCY_MS

      public static final long DEFAULT_LATENCY_MS
      the default latency (5000ms = five seconds).
      Since:
      1.0
      See Also:
  • Constructor Details

    • Builder

      public Builder(Set<Source> sourceSet)
      constructor from fixed source set.
      Parameters:
      sourceSet - fixed source set
      Throws:
      NullPointerException - if the source set is null
      Since:
      1.0
  • Method Details

    • setName

      public FixedSetSources.Builder setName(String name)
      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

      public FixedSetSources.Builder setCompilerFactory(CompilerFactory compilerFactory)
      sets the compiler factory for compiling sources, default is a new instance of DefaultGroovyCompilerFactory.
      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

      public FixedSetSources.Builder setLatencyMs(long latencyMs)
      sets the latency in milliseconds for checking if script files in the directory have changed, default is DEFAULT_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
    • getSourceSet

      public Set<Source> getSourceSet()
      gets the fixed source set.
      Returns:
      fixed source set
      Since:
      1.0
    • getName

      public String getName()
      gets the sources name.
      Returns:
      sources name
      Since:
      1.0
    • getCompilerFactory

      public CompilerFactory 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

      public FixedSetSources build()
      builds a new instance of FixedSetSources.
      Returns:
      new instance
      Since:
      1.0