Class Feature
java.lang.Object
org.apache.sling.provisioning.model.Traceable
org.apache.sling.provisioning.model.Commentable
org.apache.sling.provisioning.model.Feature
- All Implemented Interfaces:
Comparable<Feature>
A feature is a collection of
- a name
- a version
- variables
- run modes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Get all additional sectionsgetAdditionalSections
(String name) Get all sections with the given name.getName()
Get the name of the feature.getOrCreateRunMode
(String[] names) Get or create the run mode.getRunMode
(String... runModes) Find the run mode if availableGet all run modes.getType()
Get the feature type.Get all variablesGet the version of the feature.boolean
Special feature?void
Set the feature type.void
setVersion
(String v) Set the version.toString()
Methods inherited from class org.apache.sling.provisioning.model.Commentable
getComment, setComment
Methods inherited from class org.apache.sling.provisioning.model.Traceable
getLocation, setLocation
-
Constructor Details
-
Feature
Construct a new feature.- Parameters:
name
- The feature name
-
-
Method Details
-
getName
Get the name of the feature.- Returns:
- The name or
null
for an anonymous feature.
-
getVersion
Get the version of the feature.- Returns:
- The version string or
null
- Since:
- 1.6.0
-
isSpecial
public boolean isSpecial()Special feature?- Returns:
- true if the feature is special
-
getVariables
Get all variables- Returns:
- The set of variables
-
getRunModes
Get all run modes.- Returns:
- The list of run modes.
-
getRunMode
Find the run mode if available- Parameters:
runModes
- The run modes ornull
- Returns:
- The feature or
null
.
-
getOrCreateRunMode
Get or create the run mode.- Parameters:
names
- The run modes.- Returns:
- The run mode for the given run modes names.
-
getType
Get the feature type.- Returns:
- The feature type.
- Since:
- 1.4.0
-
setVersion
Set the version.- Parameters:
v
- The new version- Since:
- 1.6.0
-
setType
Set the feature type.- Parameters:
t
- The new type- Since:
- 1.4.0
-
getAdditionalSections
Get all additional sections- Returns:
- The list of additional sections. It might be empty.
- Since:
- 1.4.0
-
getAdditionalSections
Get all sections with the given name.- Parameters:
name
- The section name.- Returns:
- The list of sections. The list might be empty.
- Since:
- 1.4.0
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Feature>
-
toString
- Overrides:
toString
in classCommentable
-