Package com.atlassian.bamboo.variable
Interface VariableContext
-
- All Superinterfaces:
ImmutableVariableContext
,Serializable
- All Known Implementing Classes:
VariableContextImpl
@PublicApi public interface VariableContext extends ImmutableVariableContext
A bag for all variable related data insideCommonContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addLocalVariable(@NotNull String key, @NotNull String value)
Add generated local (a.k.a CUSTOM) variable to this context.void
addResultVariable(@NotNull String key, @NotNull String value)
Add generated result variable to this context.@NotNull Map<String,VariableSubstitutionContext>
getSubstitutions()
void
removeLocalVariable(@NotNull String key)
-
Methods inherited from interface com.atlassian.bamboo.variable.ImmutableVariableContext
getEffectiveVariables, getInitialState, getOriginalVariables, getParentContext, getPasswordVariables, getResultVariables
-
-
-
-
Method Detail
-
addLocalVariable
void addLocalVariable(@NotNull @NotNull String key, @NotNull @NotNull String value)
Add generated local (a.k.a CUSTOM) variable to this context. Local variables are only accessible from this context and are not persisted. Local variables hide any existing variables (but their value is not changed). However if you define a result variable with the same key after defining local variable, local variable will be removed. Calling this method second time with the same key assigns new value to the variable.- Since:
- 5.7
-
addResultVariable
void addResultVariable(@NotNull @NotNull String key, @NotNull @NotNull String value)
Add generated result variable to this context. Result variables are persisted with the result and are available in subsequent stages of the plan and in deployment version created from a result. Result variables hide any global or plan variables (but their value is not changed). If a local variable exists with the same key, it will be removed. Calling this method second time with the same key assigns new value to the variable.- Parameters:
key
-value
-- Since:
- 5.7
-
getSubstitutions
@NotNull @NotNull Map<String,VariableSubstitutionContext> getSubstitutions()
- Returns:
- variables used in current build
-
removeLocalVariable
void removeLocalVariable(@NotNull @NotNull String key)
-
-