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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CapabilitySetImpl()
CapabilitySetImpl(CapabilityScope capabilityScope)
CapabilitySetImpl(CapabilityScope capabilityScope, Capability... capabilities)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCapability(@NotNull Capability capability)
Add a capability to the set.void
addCapability(@NotNull Capability capability, boolean overwrite)
Adds a capability.int
compareTo(Object obj)
boolean
equals(Object o)
@NotNull Set<Capability>
getCapabilities()
Get all the capabilities as a set@Nullable Capability
getCapability(@NotNull String key)
Get the capability with the given key@NotNull CapabilityScope
getCapabilityScope()
The scope of the capability set.String
getCapabilitySetType()
Returns the identifier describing the type of this capability.@Nullable String
getSharedCapabilitySetType()
Returns the identifier for the set if it is shared.int
hashCode()
void
removeCapability(@NotNull String key)
Remove a capability from the set, by the key.void
setCapabilities(Set<Capability> capabilities)
void
setCapabilityScope(CapabilityScope capabilityScope)
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
-
CapabilitySetImpl
public CapabilitySetImpl()
-
CapabilitySetImpl
public CapabilitySetImpl(CapabilityScope capabilityScope, Capability... capabilities)
-
CapabilitySetImpl
public CapabilitySetImpl(CapabilityScope capabilityScope)
-
-
Method Detail
-
getCapability
@Nullable public @Nullable Capability getCapability(@NotNull @NotNull String key)
Description copied from interface:ReadOnlyCapabilitySet
Get the capability with the given key- Specified by:
getCapability
in interfaceReadOnlyCapabilitySet
- Returns:
-
getCapabilities
@NotNull public @NotNull Set<Capability> getCapabilities()
Description copied from interface:ReadOnlyCapabilitySet
Get all the capabilities as a set- Specified by:
getCapabilities
in interfaceReadOnlyCapabilitySet
- Returns:
-
addCapability
public void addCapability(@NotNull @NotNull Capability capability)
Description copied from interface:CapabilitySet
Add a capability to the set. Will overwrite any existing capability key- Specified by:
addCapability
in interfaceCapabilitySet
-
addCapability
public void addCapability(@NotNull @NotNull Capability capability, boolean overwrite)
Description copied from interface:CapabilitySet
Adds a capability. If overwrite is false the new value will be rejected- Specified by:
addCapability
in interfaceCapabilitySet
-
removeCapability
public void removeCapability(@NotNull @NotNull String key)
Description copied from interface:CapabilitySet
Remove a capability from the set, by the key.- Specified by:
removeCapability
in interfaceCapabilitySet
-
getCapabilityScope
@NotNull public @NotNull CapabilityScope getCapabilityScope()
Description copied from interface:CapabilitySet
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:
CapabilityScope
-
getSharedCapabilitySetType
@Nullable public @Nullable String getSharedCapabilitySetType()
Description copied from interface:CapabilitySet
Returns the identifier for the set if it is shared. Pretty used exclusively in the UI.- Specified by:
getSharedCapabilitySetType
in interfaceCapabilitySet
- Returns:
- "Local", "Remote" or null it not a shared capability type;
-
getCapabilitySetType
public String getCapabilitySetType()
Description copied from interface:CapabilitySet
Returns the identifier describing the type of this capability.- Specified by:
getCapabilitySetType
in interfaceCapabilitySet
- Returns:
- "Local", "Remote" or "Image"
-
setCapabilities
public void setCapabilities(Set<Capability> capabilities)
- Specified by:
setCapabilities
in interfaceCapabilitySet
-
setCapabilityScope
public void setCapabilityScope(CapabilityScope capabilityScope)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classcom.atlassian.core.bean.EntityObject
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classcom.atlassian.core.bean.EntityObject
-
compareTo
public int compareTo(Object obj)
-
-