Class CapabilityHelperImpl
- java.lang.Object
-
- com.atlassian.bamboo.v2.build.agent.capability.CapabilityHelperImpl
-
- All Implemented Interfaces:
CapabilityHelper
public class CapabilityHelperImpl extends Object implements CapabilityHelper
Class that helps the display and configuration of capabilities and requirements
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,CapabilityType>
builtinCapabilityTypes
-
Constructor Summary
Constructors Constructor Description CapabilityHelperImpl(com.atlassian.plugin.PluginAccessor pluginAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull com.opensymphony.webwork.dispatcher.json.JSONObject
buildCapabilityJsonObject(@NotNull Capability capability)
Build JSON object from capability.@Nullable String
getCapabilityExtraInfo(String key)
tries to figure out the extra information of a capability based on the key.@NotNull String
getCapabilityLabel(String key)
Tries to figure out the capability Label.String
getCapabilityTabForKey(String key)
Get the jquery represnetation of the capability to pick the correct tab to navigate to.String
getCapabilityType(String key)
The key of the type of capability e.g.@NotNull CapabilityType
getCapabilityTypeFromKey(String key)
get capability Type object from capability key.@Nullable CapabilityType
getCapabilityTypeFromTypeString(String capabilityTypeKey)
List<CapabilityType>
getCapabilityTypes()
Collection<BuilderCapabilityDescriptor>
getFilteredBuildersFromTypeString(String capabilityTypeKey, String capabilityPrefix)
-
-
-
Field Detail
-
builtinCapabilityTypes
protected final Map<String,CapabilityType> builtinCapabilityTypes
-
-
Method Detail
-
buildCapabilityJsonObject
@NotNull public @NotNull com.opensymphony.webwork.dispatcher.json.JSONObject buildCapabilityJsonObject(@NotNull @NotNull Capability capability) throws com.opensymphony.webwork.dispatcher.json.JSONException
Build JSON object from capability.- Specified by:
buildCapabilityJsonObject
in interfaceCapabilityHelper
- Parameters:
capability
- Capability- Returns:
- JSON object
- Throws:
com.opensymphony.webwork.dispatcher.json.JSONException
- When an error occurs during creation of JSON object
-
getCapabilityTypeFromTypeString
@Nullable public @Nullable CapabilityType getCapabilityTypeFromTypeString(String capabilityTypeKey)
- Specified by:
getCapabilityTypeFromTypeString
in interfaceCapabilityHelper
-
getFilteredBuildersFromTypeString
public Collection<BuilderCapabilityDescriptor> getFilteredBuildersFromTypeString(String capabilityTypeKey, String capabilityPrefix)
- Specified by:
getFilteredBuildersFromTypeString
in interfaceCapabilityHelper
-
getCapabilityTypeFromKey
@NotNull public @NotNull CapabilityType getCapabilityTypeFromKey(String key)
Description copied from interface:CapabilityHelper
get capability Type object from capability key. e.g. Jdk, Builder, Generic (for custom)- Specified by:
getCapabilityTypeFromKey
in interfaceCapabilityHelper
- Parameters:
key
- of the capability- Returns:
- capbilty type for the given key
-
getCapabilityType
public String getCapabilityType(String key)
Description copied from interface:CapabilityHelper
The key of the type of capability e.g. "jdk"- Specified by:
getCapabilityType
in interfaceCapabilityHelper
- Parameters:
key
- of the capability- Returns:
- key representing the capability type
-
getCapabilityLabel
@NotNull public @NotNull String getCapabilityLabel(String key)
Tries to figure out the capability Label. If it fails it will return the original key.- Specified by:
getCapabilityLabel
in interfaceCapabilityHelper
- Parameters:
key
- to find the label for- Returns:
- the label for the capability (or the original passed in key, if it fails)
-
getCapabilityExtraInfo
@Nullable public @Nullable String getCapabilityExtraInfo(String key)
tries to figure out the extra information of a capability based on the key. If it fails it returns null.- Specified by:
getCapabilityExtraInfo
in interfaceCapabilityHelper
- Parameters:
key
- of the capability- Returns:
- the extra information (pretty) for that capability.
-
getCapabilityTabForKey
public String getCapabilityTabForKey(String key)
Get the jquery represnetation of the capability to pick the correct tab to navigate to.- Specified by:
getCapabilityTabForKey
in interfaceCapabilityHelper
- Parameters:
key
- to replace (usually the Label of the capability)- Returns:
- jquery representation of the key.
-
getCapabilityTypes
public List<CapabilityType> getCapabilityTypes()
- Specified by:
getCapabilityTypes
in interfaceCapabilityHelper
- Returns:
- a list of all selectable capability types.
-
-