Class Requirement
- java.lang.Object
-
- com.atlassian.bamboo.specs.api.builders.EntityPropertiesBuilder<RequirementProperties>
-
- com.atlassian.bamboo.specs.api.builders.requirement.Requirement
-
public class Requirement extends EntityPropertiesBuilder<RequirementProperties>
Represents a custom requirement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRequirement.MatchType
-
Constructor Summary
Constructors Constructor Description Requirement(java.lang.String key)Specifies an "exists" requirement with a specified key.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RequirementPropertiesbuild()static Requirementequals(java.lang.String key, java.lang.String value)Specifies a requirement that a capability with matching key has value equal to value of requirement.static Requirementexists(java.lang.String key)Specifies a requirement that a capability with matching key exists.static Requirementmatches(java.lang.String key, java.lang.String regexp)Specifies a requirement that a capability with matching key has value that matches regexp provided in value of requirement.RequirementmatchType(Requirement.MatchType matchType)Sets a match type.RequirementmatchValue(java.lang.String value)Sets a requirement value.
-
-
-
Method Detail
-
exists
public static Requirement exists(java.lang.String key)
Specifies a requirement that a capability with matching key exists.- Parameters:
key- requirement key
-
equals
public static Requirement equals(java.lang.String key, java.lang.String value)
Specifies a requirement that a capability with matching key has value equal to value of requirement.- Parameters:
key- requirement keyvalue- requirement value
-
matches
public static Requirement matches(java.lang.String key, java.lang.String regexp)
Specifies a requirement that a capability with matching key has value that matches regexp provided in value of requirement.- Parameters:
key- requirement keyregexp- requirement value, in Java format- See Also:
Pattern
-
matchValue
public Requirement matchValue(java.lang.String value)
Sets a requirement value. Depending on the match type should be a string or a Java regular expression.
-
matchType
public Requirement matchType(Requirement.MatchType matchType)
Sets a match type. Possible values are:- EXISTS
- A capability with a matching key must exist, the value is not checked
- EQUALS
- A capability with a matching key must exist and its value must be equal to value of requirement
- MATCHES
- A capability with a matching key must exist and its value must match the value of requirement interpreted as Java regular expression
-
build
protected RequirementProperties build()
- Specified by:
buildin classEntityPropertiesBuilder<RequirementProperties>
-
-