Class Options.Builder

java.lang.Object
org.refcodes.runtime.Options.Builder
Direct Known Subclasses:
DiagnosticOptions.Builder
Enclosing class:
Options

public static class Options.Builder extends Object
Builder for creating Options instances.

The builder follows the fluent builder pattern and allows incremental construction of option sets.

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withProperty

      public Options.Builder withProperty(String aKey, Object aValue)
      Adds a custom property to the options.
      Parameters:
      aKey - The enumeration representing the key by resolving to its name (as of Enum.name().
      aValue - the property value.
      Returns:
      this builder instance
    • withProperty

      public Options.Builder withProperty(Enum aKey, Object aValue)
      Adds a custom property to the options.
      Parameters:
      aKey - the property key
      aValue - the property value
      Returns:
      this builder instance
    • build

      public Options build()
      Builds a new instance from the accumulated options.
      Returns:
      The accordingly constructed options.