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>
public class Feature extends Commentable implements Comparable<Feature>
A feature is a collection of - a name - a version - variables - run modes
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Feature o)List<Section>getAdditionalSections()Get all additional sectionsList<Section>getAdditionalSections(String name)Get all sections with the given name.StringgetName()Get the name of the feature.RunModegetOrCreateRunMode(String[] names)Get or create the run mode.RunModegetRunMode(String... runModes)Find the run mode if availableList<RunMode>getRunModes()Get all run modes.StringgetType()Get the feature type.KeyValueMap<String>getVariables()Get all variablesStringgetVersion()Get the version of the feature.booleanisSpecial()Special feature?voidsetType(String t)Set the feature type.voidsetVersion(String v)Set the version.StringtoString()-
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 Detail
-
Feature
public Feature(String name)
Construct a new feature.- Parameters:
name- The feature name
-
-
Method Detail
-
getName
public String getName()
Get the name of the feature.- Returns:
- The name or
nullfor an anonymous feature.
-
getVersion
public String 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
public KeyValueMap<String> getVariables()
Get all variables- Returns:
- The set of variables
-
getRunMode
public RunMode getRunMode(String... runModes)
Find the run mode if available- Parameters:
runModes- The run modes ornull- Returns:
- The feature or
null.
-
getOrCreateRunMode
public RunMode getOrCreateRunMode(String[] names)
Get or create the run mode.- Parameters:
names- The run modes.- Returns:
- The run mode for the given run modes names.
-
getType
public String getType()
Get the feature type.- Returns:
- The feature type.
- Since:
- 1.4.0
-
setVersion
public void setVersion(String v)
Set the version.- Parameters:
v- The new version- Since:
- 1.6.0
-
setType
public void setType(String t)
Set the feature type.- Parameters:
t- The new type- Since:
- 1.4.0
-
getAdditionalSections
public List<Section> getAdditionalSections()
Get all additional sections- Returns:
- The list of additional sections. It might be empty.
- Since:
- 1.4.0
-
getAdditionalSections
public List<Section> getAdditionalSections(String name)
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
public int compareTo(Feature o)
- Specified by:
compareToin interfaceComparable<Feature>
-
toString
public String toString()
- Overrides:
toStringin classCommentable
-
-