Class BrowserlessConfiguration.Builder

java.lang.Object
com.vaadin.browserless.BrowserlessConfiguration.Builder
Enclosing class:
BrowserlessConfiguration

public static final class BrowserlessConfiguration.Builder extends Object
Builder for BrowserlessConfiguration instances.
  • Method Details

    • withApplicationProperty

      public BrowserlessConfiguration.Builder withApplicationProperty(String name, String value)
      Sets a Vaadin application property (init parameter) to apply to the mock Vaadin environment. A previously set value for the same name is replaced.
      Parameters:
      name - the property name, not null
      value - the property value, not null
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the name is blank or reserved by the browserless environment
    • withApplicationProperties

      public BrowserlessConfiguration.Builder withApplicationProperties(Map<String,String> properties)
      Sets Vaadin application properties (init parameters) to apply to the mock Vaadin environment. Previously set values for the same names are replaced.
      Parameters:
      properties - the properties to set, not null
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if a name is blank or reserved by the browserless environment
    • withFeatureFlags

      public BrowserlessConfiguration.Builder withFeatureFlags(String... featureIds)
      Enables the given Vaadin feature flags, overriding the values potentially defined in the vaadin-featureflags.properties file or in system properties.
      Parameters:
      featureIds - the identifiers of the features to enable, not null
      Returns:
      this builder
    • withFeatureFlags

      public BrowserlessConfiguration.Builder withFeatureFlags(Feature... features)
      Enables the given Vaadin feature flags, overriding the values potentially defined in the vaadin-featureflags.properties file or in system properties.
      Parameters:
      features - the features to enable, not null
      Returns:
      this builder
    • withFeatureFlag

      public BrowserlessConfiguration.Builder withFeatureFlag(String featureId, boolean enabled)
      Enables or disables the given Vaadin feature flag, overriding the value potentially defined in the vaadin-featureflags.properties file or in system properties.
      Parameters:
      featureId - the identifier of the feature, not null
      enabled - true to enable the feature, false to disable it
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the feature identifier is blank
    • withFeatureFlag

      public BrowserlessConfiguration.Builder withFeatureFlag(Feature feature, boolean enabled)
      Enables or disables the given Vaadin feature flag, overriding the value potentially defined in the vaadin-featureflags.properties file or in system properties.
      Parameters:
      feature - the feature, not null
      enabled - true to enable the feature, false to disable it
      Returns:
      this builder
    • withLookupServices

      public BrowserlessConfiguration.Builder withLookupServices(Class<?>... services)
      Adds the given service implementation classes to the ones used to initialize the Vaadin Lookup, such as InstantiatorFactory or ResourceProvider implementations.

      Successive calls accumulate; lookup services are never replaced. Calling with no arguments is a no-op.

      Parameters:
      services - the service implementation classes to add, not null
      Returns:
      this builder
    • withConfiguration

      public BrowserlessConfiguration.Builder withConfiguration(BrowserlessConfiguration configuration)
      Applies all entries of the given configuration to this builder, replacing previously set application properties and feature flags with the same names, and accumulating lookup services.
      Parameters:
      configuration - the configuration to apply, not null
      Returns:
      this builder
    • build

      public BrowserlessConfiguration build()
      Builds the configuration.
      Returns:
      a new configuration, never null