Class RequirementSetImpl
- java.lang.Object
-
- com.atlassian.core.bean.EntityObject
-
- com.atlassian.bamboo.core.BambooEntityObject
-
- com.atlassian.bamboo.v2.build.agent.capability.RequirementSetImpl
-
- All Implemented Interfaces:
BambooIdProvider
,BambooObject
,MinimalRequirementSet
,RequirementSet
,ImmutableRequirementSet
,Cloneable
@Entity public class RequirementSetImpl extends BambooEntityObject implements RequirementSet
-
-
Constructor Summary
Constructors Constructor Description RequirementSetImpl()
RequirementSetImpl(@NotNull RequirementSet other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllRequirements(Iterable<Requirement> requirements)
Adds all the specified requirements to the setvoid
addRequirement(@NotNull Requirement requirement)
Adds a requirement to the set.boolean
equals(Object o)
Requirement
getRequirement(long id)
Get a requirement from the set via the id.Requirement
getRequirement(@NotNull String key, long ownerId)
Get a requirement from the set via the key and ownerId.@NotNull Set<Requirement>
getRequirements()
Get all requirements as aSet
Set<Requirement>
getRequirementsForPlugin(@NotNull String pluginModuleKey, long ownerId)
Gets all requirements that match the specifiedImmutableRequirement.getPluginModuleKey()
andImmutableRequirement.getOwnerId()
@NotNull Set<Requirement>
getSystemRequirements(String type)
Gets a subset of requirements which are of a particular system type.int
hashCode()
boolean
removeRequirement(@NotNull ImmutableRequirement requirement)
Removes the requirement from the set.int
removeRequirements(@NotNull com.google.common.base.Predicate<Requirement> requirementPredicate)
Remove requirements from set if they match the givenPredicate
int
removeRequirements(@NotNull Iterable<Requirement> requirementIterable)
Removes all the specifiedRequirement
s from the set.void
setRequirements(Set<Requirement> requirements)
String
toString()
-
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
-
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
-
-
-
-
Constructor Detail
-
RequirementSetImpl
public RequirementSetImpl()
-
RequirementSetImpl
public RequirementSetImpl(@NotNull @NotNull RequirementSet other)
-
-
Method Detail
-
getRequirement
public Requirement getRequirement(@NotNull @NotNull String key, long ownerId)
Description copied from interface:RequirementSet
Get a requirement from the set via the key and ownerId.- Specified by:
getRequirement
in interfaceRequirementSet
- Returns:
- requirement
-
getRequirement
public Requirement getRequirement(long id)
Description copied from interface:RequirementSet
Get a requirement from the set via the id.- Specified by:
getRequirement
in interfaceImmutableRequirementSet
- Specified by:
getRequirement
in interfaceRequirementSet
- Returns:
- requirement
-
getRequirements
@NotNull public @NotNull Set<Requirement> getRequirements()
Description copied from interface:ImmutableRequirementSet
Get all requirements as aSet
- Specified by:
getRequirements
in interfaceImmutableRequirementSet
- Specified by:
getRequirements
in interfaceRequirementSet
- Returns:
- requirements
-
getRequirementsForPlugin
public Set<Requirement> getRequirementsForPlugin(@NotNull @NotNull String pluginModuleKey, long ownerId)
Description copied from interface:RequirementSet
Gets all requirements that match the specifiedImmutableRequirement.getPluginModuleKey()
andImmutableRequirement.getOwnerId()
- Specified by:
getRequirementsForPlugin
in interfaceRequirementSet
- Returns:
- requirements
-
addRequirement
public void addRequirement(@NotNull @NotNull Requirement requirement)
Description copied from interface:RequirementSet
Adds a requirement to the set.- Specified by:
addRequirement
in interfaceRequirementSet
-
addAllRequirements
public void addAllRequirements(Iterable<Requirement> requirements)
Description copied from interface:RequirementSet
Adds all the specified requirements to the set- Specified by:
addAllRequirements
in interfaceRequirementSet
-
removeRequirement
public boolean removeRequirement(@NotNull @NotNull ImmutableRequirement requirement)
Description copied from interface:RequirementSet
Removes the requirement from the set.- Specified by:
removeRequirement
in interfaceRequirementSet
- Parameters:
requirement
- to remove- Returns:
- removed if the requirement was removed
-
removeRequirements
public int removeRequirements(@NotNull @NotNull com.google.common.base.Predicate<Requirement> requirementPredicate)
Description copied from interface:RequirementSet
Remove requirements from set if they match the givenPredicate
- Specified by:
removeRequirements
in interfaceRequirementSet
- Parameters:
requirementPredicate
- for requirements to be removed from the currentRequirementSet
- Returns:
- count of matching requirements removed
-
removeRequirements
public int removeRequirements(@NotNull @NotNull Iterable<Requirement> requirementIterable)
Description copied from interface:RequirementSet
Removes all the specifiedRequirement
s from the set.- Specified by:
removeRequirements
in interfaceRequirementSet
- Parameters:
requirementIterable
- to remove- Returns:
- count of matching requirements removed
-
getSystemRequirements
@NotNull public @NotNull Set<Requirement> getSystemRequirements(String type)
Description copied from interface:RequirementSet
Gets a subset of requirements which are of a particular system type. e.g. system.builder or system.jdk.- Specified by:
getSystemRequirements
in interfaceRequirementSet
- Returns:
- requirements
-
setRequirements
public void setRequirements(Set<Requirement> requirements)
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classcom.atlassian.core.bean.EntityObject
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classcom.atlassian.core.bean.EntityObject
-
-