Package com.vaadin.browserless
Class BrowserlessConfiguration.Builder
java.lang.Object
com.vaadin.browserless.BrowserlessConfiguration.Builder
- Enclosing class:
BrowserlessConfiguration
Builder for
BrowserlessConfiguration instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configuration.withApplicationProperties(Map<String, String> properties) Sets Vaadin application properties (init parameters) to apply to the mock Vaadin environment.withApplicationProperty(String name, String value) Sets a Vaadin application property (init parameter) to apply to the mock Vaadin environment.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.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.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.withFeatureFlags(Feature... features) Enables the given Vaadin feature flags, overriding the values potentially defined in the vaadin-featureflags.properties file or in system properties.withFeatureFlags(String... featureIds) Enables the given Vaadin feature flags, overriding the values potentially defined in the vaadin-featureflags.properties file or in system properties.withLookupServices(Class<?>... services) Adds the given service implementation classes to the ones used to initialize the VaadinLookup, such asInstantiatorFactoryorResourceProviderimplementations.
-
Method Details
-
withApplicationProperty
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 nullvalue- the property value, not null- Returns:
- this builder
- Throws:
IllegalArgumentException- if the name is blank or reserved by the browserless environment
-
withApplicationProperties
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
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
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
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 nullenabled- true to enable the feature, false to disable it- Returns:
- this builder
- Throws:
IllegalArgumentException- if the feature identifier is blank
-
withFeatureFlag
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 nullenabled- true to enable the feature, false to disable it- Returns:
- this builder
-
withLookupServices
Adds the given service implementation classes to the ones used to initialize the VaadinLookup, such asInstantiatorFactoryorResourceProviderimplementations.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
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
Builds the configuration.- Returns:
- a new configuration, never null
-