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:
java.lang.Comparable<Feature>
public class Feature extends Commentable implements java.lang.Comparable<Feature>
A feature is a collection of - a name - a version - variables - run modes
-
-
Constructor Summary
Constructors Constructor Description Feature(java.lang.String name)
Construct a new feature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Feature o)
java.util.List<Section>
getAdditionalSections()
Get all additional sectionsjava.util.List<Section>
getAdditionalSections(java.lang.String name)
Get all sections with the given name.java.lang.String
getName()
Get the name of the feature.RunMode
getOrCreateRunMode(java.lang.String[] names)
Get or create the run mode.RunMode
getRunMode(java.lang.String... runModes)
Find the run mode if availablejava.util.List<RunMode>
getRunModes()
Get all run modes.java.lang.String
getType()
Get the feature type.KeyValueMap<java.lang.String>
getVariables()
Get all variablesjava.lang.String
getVersion()
Get the version of the feature.boolean
isSpecial()
Special feature?void
setType(java.lang.String t)
Set the feature type.void
setVersion(java.lang.String v)
Set the version.java.lang.String
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
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the name of the feature.- Returns:
- The name or
null
for an anonymous feature.
-
getVersion
public java.lang.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<java.lang.String> getVariables()
Get all variables- Returns:
- The set of variables
-
getRunModes
public java.util.List<RunMode> getRunModes()
Get all run modes.- Returns:
- The list of run modes.
-
getRunMode
public RunMode getRunMode(java.lang.String... runModes)
Find the run mode if available- Parameters:
runModes
- The run modes ornull
- Returns:
- The feature or
null
.
-
getOrCreateRunMode
public RunMode getOrCreateRunMode(java.lang.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 java.lang.String getType()
Get the feature type.- Returns:
- The feature type.
- Since:
- 1.4.0
-
setVersion
public void setVersion(java.lang.String v)
Set the version.- Parameters:
v
- The new version- Since:
- 1.6.0
-
setType
public void setType(java.lang.String t)
Set the feature type.- Parameters:
t
- The new type- Since:
- 1.4.0
-
getAdditionalSections
public java.util.List<Section> getAdditionalSections()
Get all additional sections- Returns:
- The list of additional sections. It might be empty.
- Since:
- 1.4.0
-
getAdditionalSections
public java.util.List<Section> getAdditionalSections(java.lang.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:
compareTo
in interfacejava.lang.Comparable<Feature>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classCommentable
-
-