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 Details

    • CapabilitySetImpl

      public CapabilitySetImpl()
    • CapabilitySetImpl

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

      public CapabilitySetImpl(CapabilityScope capabilityScope)
  • Method Details

    • 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 interface ReadOnlyCapabilitySet
      Returns:
    • getCapabilities

      @NotNull public @NotNull 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 @NotNull Capability capability)
      Description copied from interface: CapabilitySet
      Adds a capability to the set. Will overwrite any existing capability with the same key.
      Specified by:
      addCapability in interface CapabilitySet
      Parameters:
      capability - the capability to add
    • addCapability

      public void addCapability(@NotNull @NotNull Capability capability, boolean overwrite)
      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 interface CapabilitySet
      Parameters:
      capability - the capability to add
      overwrite - whether to overwrite an existing capability with the same key
    • removeCapability

      public void removeCapability(@NotNull @NotNull String key)
      Description copied from interface: CapabilitySet
      Removes a capability from the set by its key.
      Specified by:
      removeCapability in interface CapabilitySet
      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 interface CapabilitySet
    • getCapabilityScope

      @NotNull public @NotNull CapabilityScope getCapabilityScope()
      Description copied from interface: CapabilitySet
      Returns 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:
      the scope of the capability set
    • getSharedCapabilitySetType

      @Nullable public @Nullable String getSharedCapabilitySetType()
      Description copied from interface: CapabilitySet
      Returns the identifier for the set if it is shared. Used primarily in the UI.
      Specified by:
      getSharedCapabilitySetType in interface CapabilitySet
      Returns:
      "Local", "Remote" or null if not a shared capability type
    • getCapabilitySetType

      public String getCapabilitySetType()
      Description copied from interface: CapabilitySet
      Returns the identifier describing the type of this capability set.
      Specified by:
      getCapabilitySetType in interface CapabilitySet
      Returns:
      "Local", "Remote" or "Image"
    • setCapabilities

      public void setCapabilities(Set<Capability> capabilities)
      Description copied from interface: CapabilitySet
      Sets the capabilities of the set.
      Specified by:
      setCapabilities in interface CapabilitySet
      Parameters:
      capabilities - the set of capabilities to set
    • setCapabilityScope

      public void setCapabilityScope(CapabilityScope capabilityScope)
    • hashCode

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

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

      public int compareTo(Object obj)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • readResolve

      protected Object readResolve()