Class CapabilitySetImpl
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.bamboo.core.BambooEntityObject
com.atlassian.bamboo.v2.build.agent.capability.CapabilitySetImpl
- All Implemented Interfaces:
BambooIdProvider
,BambooObject
,CapabilitySet
,ReadOnlyCapabilitySet
,Serializable
,Cloneable
- Direct Known Subclasses:
EphemeralAgentTemplateCapabilitySetImpl
,ImageCapabilitySetImpl
,LocalCapabilitySet
,RemoteCapabilitySet
@NotThreadSafe
@Entity
public class CapabilitySetImpl
extends BambooEntityObject
implements CapabilitySet
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCapabilitySetImpl
(CapabilityScope capabilityScope) CapabilitySetImpl
(CapabilityScope capabilityScope, Capability... capabilities) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCapability
(@NotNull Capability capability) Adds a capability to the set.void
addCapability
(@NotNull Capability capability, boolean overwrite) Adds a capability to the set.int
boolean
@NotNull Set<Capability>
Get all the capabilities as a set@Nullable Capability
getCapability
(@NotNull String key) Get the capability with the given key@NotNull CapabilityScope
Returns the scope of the capability set.Returns the identifier describing the type of this capability set.@Nullable String
Returns the identifier for the set if it is shared.int
hashCode()
protected Object
void
Removes all capabilities from the set.void
removeCapability
(@NotNull String key) Removes a capability from the set by its key.void
setCapabilities
(Set<Capability> capabilities) Sets the capabilities of the set.void
setCapabilityScope
(CapabilityScope capabilityScope) 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 Details
-
CapabilitySetImpl
public CapabilitySetImpl() -
CapabilitySetImpl
-
CapabilitySetImpl
-
-
Method Details
-
getCapability
Description copied from interface:ReadOnlyCapabilitySet
Get the capability with the given key- Specified by:
getCapability
in interfaceReadOnlyCapabilitySet
- Returns:
-
getCapabilities
Description copied from interface:ReadOnlyCapabilitySet
Get all the capabilities as a set- Specified by:
getCapabilities
in interfaceReadOnlyCapabilitySet
- Returns:
-
addCapability
Description copied from interface:CapabilitySet
Adds a capability to the set. Will overwrite any existing capability with the same key.- Specified by:
addCapability
in interfaceCapabilitySet
- Parameters:
capability
- the capability to add
-
addCapability
Description copied from interface:CapabilitySet
Adds a capability to the set. If overwrite is false, the new value will be rejected if a capability with the same key already exists.- Specified by:
addCapability
in interfaceCapabilitySet
- Parameters:
capability
- the capability to addoverwrite
- whether to overwrite an existing capability with the same key
-
removeCapability
Description copied from interface:CapabilitySet
Removes a capability from the set by its key.- Specified by:
removeCapability
in interfaceCapabilitySet
- Parameters:
key
- the key of the capability to remove
-
removeAllCapabilities
public void removeAllCapabilities()Description copied from interface:CapabilitySet
Removes all capabilities from the set.- Specified by:
removeAllCapabilities
in interfaceCapabilitySet
-
getCapabilityScope
Description copied from interface:CapabilitySet
Returns the scope of the capability set. Can either beCapabilityScope.AGENT
- only applies to one agent, orCapabilityScope.SHARED
- shared across all local or all remote agents.- Specified by:
getCapabilityScope
in interfaceCapabilitySet
- Returns:
- the scope of the capability set
-
getCapabilitySetType
Description copied from interface:CapabilitySet
Returns the identifier describing the type of this capability set.- Specified by:
getCapabilitySetType
in interfaceCapabilitySet
- Returns:
- "Local", "Remote" or "Image"
-
setCapabilities
Description copied from interface:CapabilitySet
Sets the capabilities of the set.- Specified by:
setCapabilities
in interfaceCapabilitySet
- Parameters:
capabilities
- the set of capabilities to set
-
setCapabilityScope
-
hashCode
public int hashCode()- Overrides:
hashCode
in classcom.atlassian.core.bean.EntityObject
-
equals
- Overrides:
equals
in classcom.atlassian.core.bean.EntityObject
-
compareTo
-
toString
-
readResolve
-