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

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.CapabilitySetImpl
All Implemented Interfaces:
BambooObject, CapabilitySet, ReadOnlyCapabilitySet, java.lang.Cloneable
Direct Known Subclasses:
ImageCapabilitySetImpl, LocalCapabilitySet, RemoteCapabilitySet

@NotThreadSafe
public class CapabilitySetImpl
extends BambooEntityObject
implements CapabilitySet


Field Summary
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Constructor Summary
CapabilitySetImpl()
           
CapabilitySetImpl(CapabilityScope capabilityScope)
           
CapabilitySetImpl(CapabilityScope capabilityScope, Capability... capabilities)
           
 
Method Summary
 void addCapability(Capability capability)
          Add a capability to the set.
 void addCapability(Capability capability, boolean overwrite)
          Adds a capability.
 int compareTo(java.lang.Object obj)
           
 boolean equals(java.lang.Object o)
           
 java.util.Set<Capability> getCapabilities()
          Get all the capabilities as a set
 Capability getCapability(java.lang.String key)
          Get the capability with the given key
 CapabilityScope getCapabilityScope()
          The scope of the capability set.
 java.lang.String getCapabilitySetType()
          Returns the identifier describing the type of this capability.
 java.lang.String getSharedCapabilitySetType()
          Returns the identifier for the set if it is shared.
 int hashCode()
           
 void removeCapability(java.lang.String key)
          Remove a capability from the set, by the key.
 void setCapabilities(java.util.Set<Capability> capabilities)
           
 void setCapabilityScope(CapabilityScope capabilityScope)
           
 
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, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
getId, setId
 

Constructor Detail

CapabilitySetImpl

public CapabilitySetImpl()

CapabilitySetImpl

public CapabilitySetImpl(CapabilityScope capabilityScope,
                         Capability... capabilities)

CapabilitySetImpl

public CapabilitySetImpl(CapabilityScope capabilityScope)
Method Detail

getCapability

public Capability getCapability(@NotNull
                                java.lang.String key)
Description copied from interface: ReadOnlyCapabilitySet
Get the capability with the given key

Specified by:
getCapability in interface ReadOnlyCapabilitySet
Returns:

getCapabilities

@NotNull
public java.util.Set<Capability> getCapabilities()
Description copied from interface: ReadOnlyCapabilitySet
Get all the capabilities as a set

Specified by:
getCapabilities in interface ReadOnlyCapabilitySet
Returns:

addCapability

public void addCapability(@NotNull
                          Capability capability)
Description copied from interface: CapabilitySet
Add a capability to the set. Will overwrite any existing capability key

Specified by:
addCapability in interface CapabilitySet

addCapability

public void addCapability(@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 interface CapabilitySet

removeCapability

public void removeCapability(@NotNull
                             java.lang.String key)
Description copied from interface: CapabilitySet
Remove a capability from the set, by the key.

Specified by:
removeCapability in interface CapabilitySet

getCapabilityScope

@NotNull
public CapabilityScope getCapabilityScope()
Description copied from interface: CapabilitySet
The scope of the capability set. Can either be CapabilityScope.AGENT - only applies to one agent. or CapabilityScope.SHARED - shared across all local, or all remote agents.

Specified by:
getCapabilityScope in interface CapabilitySet
Returns:
CapabilityScope

getSharedCapabilitySetType

@Nullable
public java.lang.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 interface CapabilitySet
Returns:
"Local", "Remote" or null it not a shared capability type;

getCapabilitySetType

public java.lang.String getCapabilitySetType()
Description copied from interface: CapabilitySet
Returns the identifier describing the type of this capability.

Specified by:
getCapabilitySetType in interface CapabilitySet
Returns:
"Local", "Remote" or "Image"

setCapabilities

public void setCapabilities(java.util.Set<Capability> capabilities)
Specified by:
setCapabilities in interface CapabilitySet

setCapabilityScope

public void setCapabilityScope(CapabilityScope capabilityScope)

hashCode

public int hashCode()
Overrides:
hashCode in class com.atlassian.core.bean.EntityObject

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class com.atlassian.core.bean.EntityObject

compareTo

public int compareTo(java.lang.Object obj)


Copyright © 2010 Atlassian. All Rights Reserved.