Package org.osgi.service.feature
Interface FeatureBuilder
@ProviderType
public interface FeatureBuilder
A builder for
Feature
Models.- "NotThreadSafe"
-
Method Summary
Modifier and TypeMethodDescriptionaddBundles
(FeatureBundle... bundles) Add Bundles to the Feature.addCategories
(String... categories) Adds one or more categories to the Feature.addConfigurations
(FeatureConfiguration... configs) Add Configurations to the Feature.addExtensions
(FeatureExtension... extensions) Add Extensions to the FeatureaddVariable
(String key, Object defaultValue) Add a variable to the Feature.addVariables
(Map<String, Object> variables) Add a map of variables to the Feature.build()
Build the Feature.setComplete
(boolean complete) Set the Feature Complete flag.setDescription
(String description) Set the Feature Description.Set the documentation URL.setLicense
(String license) Set the License.Set the Feature Name.Set the SCM information.Set the Vendor.
-
Method Details
-
setComplete
Set the Feature Complete flag. If this method is not called the complete flag defaults tofalse
.- Parameters:
complete
- If the feature is complete.- Returns:
- This builder.
-
setDescription
Set the Feature Description.- Parameters:
description
- The description.- Returns:
- This builder.
-
setDocURL
Set the documentation URL.- Parameters:
docURL
- The Documentation URL.- Returns:
- This builder.
-
setName
Set the Feature Name.- Parameters:
name
- The Name.- Returns:
- This builder.
-
setLicense
Set the License.- Parameters:
license
- The License.- Returns:
- This builder.
-
setSCM
Set the SCM information.- Parameters:
scm
- The SCM information.- Returns:
- This builder.
-
setVendor
Set the Vendor.- Parameters:
vendor
- The Vendor.- Returns:
- This builder.
-
addBundles
Add Bundles to the Feature.- Parameters:
bundles
- The Bundles to add.- Returns:
- This builder.
-
addCategories
Adds one or more categories to the Feature.- Parameters:
categories
- The Categories.- Returns:
- This builder.
-
addConfigurations
Add Configurations to the Feature.- Parameters:
configs
- The Configurations to add.- Returns:
- This builder.
-
addExtensions
Add Extensions to the Feature- Parameters:
extensions
- The Extensions to add.- Returns:
- This builder.
-
addVariable
Add a variable to the Feature. If a variable with the specified key already exists it is replaced with this one. Variable values are of type: String, Boolean or BigDecimal for numbers.- Parameters:
key
- The key.defaultValue
- The default value.- Returns:
- This builder.
- Throws:
IllegalArgumentException
- if the value is of an invalid type.
-
addVariables
Add a map of variables to the Feature. Pre-existing variables with the same key in are overwritten if these keys exist in the map. Variable values are of type: String, Boolean or BigDecimal for numbers.- Parameters:
variables
- to be added.- Returns:
- This builder.
- Throws:
IllegalArgumentException
- if a value is of an invalid type.
-
build
Feature build()Build the Feature. Can only be called once on a builder. After calling this method the current builder instance cannot be used any more.- Returns:
- The Feature.
-