com.atlassian.bamboo.v2.build.agent.capability
Class RequirementSetImpl

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.bamboo.core.BambooEntityObject
          extended by com.atlassian.bamboo.v2.build.agent.capability.RequirementSetImpl
All Implemented Interfaces:
BambooIdProvider, BambooObject, MinimalRequirementSet, RequirementSet, Cloneable

public class RequirementSetImpl
extends BambooEntityObject
implements RequirementSet


Field Summary
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Constructor Summary
RequirementSetImpl()
           
RequirementSetImpl(RequirementSet other)
           
 
Method Summary
 void addAllRequirements(Iterable<Requirement> requirements)
          Adds all the specified requirements to the set
 void addRequirement(Requirement requirement)
          Adds a requirement to the set.
 boolean equals(Object o)
          This method needs to be here in order to use proper id
 Requirement getRequirement(long id)
          Get a requirement from the set via the id.
 Requirement getRequirement(String key)
          Get a requirement from the set via the key.
 Requirement getRequirement(String key, long ownerId)
          Get a requirement from the set via the key and ownerId.
 Set<Requirement> getRequirements()
          Get all requirements as a Set
 Set<Requirement> getRequirementsForPlugin(String pluginModuleKey, long ownerId)
          Gets all requirements that match the specified ImmutableRequirement.getPluginModuleKey() and ImmutableRequirement.getOwnerId()
 Set<Requirement> getSystemRequirements(String type)
          Gets a subset of requirements which are of a particular system type.
 int hashCode()
          This method needs to be here in order to use proper id
 boolean removeRequirement(ImmutableRequirement requirement)
          Removes the requirement from the set.
 void removeRequirement(String key)
          Removes all the requirements matching the key from the set.
 int removeRequirements(Iterable<Requirement> requirementIterable)
          Removes all the specified Requirements from the set.
 int removeRequirements(com.google.common.base.Predicate<Requirement> requirementPredicate)
          Remove requirements from set if they match the given Predicate
 void setRequirements(Set<Requirement> requirements)
           
 String toString()
           
 
Methods inherited from class com.atlassian.bamboo.core.BambooEntityObject
getId, setId
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getLastModificationDate, setClock, setCreationDate, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
 
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
 

Constructor Detail

RequirementSetImpl

public RequirementSetImpl()

RequirementSetImpl

public RequirementSetImpl(@NotNull
                          RequirementSet other)
Method Detail

getRequirement

public Requirement getRequirement(@NotNull
                                  String key)
Description copied from interface: RequirementSet
Get a requirement from the set via the key.

Specified by:
getRequirement in interface RequirementSet
Returns:
requirement

getRequirement

public Requirement getRequirement(@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 interface RequirementSet
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 interface RequirementSet
Returns:
requirement

getRequirements

@NotNull
public Set<Requirement> getRequirements()
Description copied from interface: MinimalRequirementSet
Get all requirements as a Set

Specified by:
getRequirements in interface MinimalRequirementSet
Returns:
requirements

getRequirementsForPlugin

public Set<Requirement> getRequirementsForPlugin(@NotNull
                                                 String pluginModuleKey,
                                                 long ownerId)
Description copied from interface: RequirementSet
Gets all requirements that match the specified ImmutableRequirement.getPluginModuleKey() and ImmutableRequirement.getOwnerId()

Specified by:
getRequirementsForPlugin in interface RequirementSet
Returns:
requirements

addRequirement

public void addRequirement(@NotNull
                           Requirement requirement)
Description copied from interface: RequirementSet
Adds a requirement to the set.

Specified by:
addRequirement in interface RequirementSet

addAllRequirements

public void addAllRequirements(Iterable<Requirement> requirements)
Description copied from interface: RequirementSet
Adds all the specified requirements to the set

Specified by:
addAllRequirements in interface RequirementSet

removeRequirement

public void removeRequirement(@NotNull
                              String key)
Description copied from interface: RequirementSet
Removes all the requirements matching the key from the set.

Specified by:
removeRequirement in interface RequirementSet

removeRequirement

public boolean removeRequirement(@NotNull
                                 ImmutableRequirement requirement)
Description copied from interface: RequirementSet
Removes the requirement from the set.

Specified by:
removeRequirement in interface RequirementSet
Parameters:
requirement - to remove
Returns:
removed if the requirement was removed

removeRequirements

public int removeRequirements(@NotNull
                              com.google.common.base.Predicate<Requirement> requirementPredicate)
Description copied from interface: RequirementSet
Remove requirements from set if they match the given Predicate

Specified by:
removeRequirements in interface RequirementSet
Parameters:
requirementPredicate - for requirements to be removed from the current RequirementSet
Returns:
count of matching requirements removed

removeRequirements

public int removeRequirements(@NotNull
                              Iterable<Requirement> requirementIterable)
Description copied from interface: RequirementSet
Removes all the specified Requirements from the set.

Specified by:
removeRequirements in interface RequirementSet
Parameters:
requirementIterable - to remove
Returns:
count of matching requirements removed

getSystemRequirements

@NotNull
public 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 interface RequirementSet
Returns:
requirements

setRequirements

public void setRequirements(Set<Requirement> requirements)

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Description copied from class: BambooEntityObject
This method needs to be here in order to use proper id

Overrides:
equals in class BambooEntityObject

hashCode

public int hashCode()
Description copied from class: BambooEntityObject
This method needs to be here in order to use proper id

Overrides:
hashCode in class BambooEntityObject


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.