Interface CustomVariableContext

    • Method Detail

      • substituteString

        @Contract("null -> null; !null -> !null")
        String substituteString​(@Nullable
                                @Nullable String value)
        Substitutes variables in the input string with their values using data from existing ThreadLocal state.
        Parameters:
        value - input string
        Returns:
        substituted string
      • getVariableContexts

        @NotNull
        @NotNull Map<String,​VariableDefinitionContext> getVariableContexts()
        Get all variables from current thread local context.
        Returns:
        mapping between variable keys and contexts
        Since:
        5.9
      • removeAllVariables

        @NotNull
        @NotNull String removeAllVariables​(@NotNull
                                           @NotNull String unparsedString)
        Given a string, remove all variable patterns.
        Parameters:
        unparsedString - string values to be analyzed
        Returns:
        value with variables removed
      • getSubstitutedVariables

        @NotNull
        @NotNull Map<String,​VariableSubstitutionContext> getSubstitutedVariables()
        Get all the variables that have previously been substituted in this thread.
        Returns:
      • findAllVariables

        @NotNull
        @NotNull Set<String> findAllVariables​(@Nullable
                                              @Nullable String stringWithVariables)
        Given a string, all patterns in the string matching ${bamboo.<variable>} or ${system.<variable>} will be found.
        Parameters:
        stringWithVariables - String value to be analyzed
        Returns:
        Array of string values with variables extrapolated
      • getBuildInRepositoryVariablesIfBuildContext

        @NotNull
        @NotNull Map<String,​VariableDefinitionContext> getBuildInRepositoryVariablesIfBuildContext()
        Return variables all built-in variables produced by repository plugin for the current build context. Current thread local state must contain BuildContext, otherwise returned map will be empty. Note: variables are used in repository definition, they will be resolved according to current state of the CustomVariableContext
        Since:
        5.9
      • withVariableSubstitutor

        void withVariableSubstitutor​(@NotNull
                                     @NotNull VariableSubstitutor variableSubstitutor,
                                     @NotNull
                                     @NotNull Runnable runnable)
        Run operation with provided VariableSubstitutor in thread local context. Restore current thread local state when finished.
        Since:
        5.9
      • withVariableSubstitutor

        <V> V withVariableSubstitutor​(@NotNull
                                      @NotNull VariableSubstitutor variableSubstitutor,
                                      @NotNull
                                      @NotNull Callable<V> callable)
                               throws Exception
        Run operation with provided VariableSubstitutor in thread local context. Restore current thread local state when finished.
        Throws:
        Exception
        Since:
        5.9
      • withVariableSubstitutor

        <V> V withVariableSubstitutor​(@NotNull
                                      @NotNull VariableSubstitutor variableSubstitutor,
                                      @NotNull
                                      @NotNull Supplier<V> supplier)
        Run operation with provided VariableSubstitutor in thread local context. Restore current thread local state when finished.
        Since:
        5.9