org.apache.jmeter.engine.util

## Class CompoundVariable

- java.lang.Object
- - org.apache.jmeter.engine.util.CompoundVariable

- All Implemented Interfaces:
    Function

      public class CompoundVariable
      extends java.lang.Object
      implements Function

  CompoundFunction.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompoundVariable()`
    `CompoundVariable(java.lang.String parameters)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `java.lang.String` | `execute()`
    `java.lang.String` | `execute(SampleResult previousResult, Sampler currentSampler)` Given the previous SampleResult and the current Sampler, return a string to use as a replacement value for the function call.
    `java.util.List<java.lang.String>` | `getArgumentDesc()` Return a list of strings briefly describing each parameter your function takes.
    `CompoundVariable` | `getFunction()`
    `static java.lang.Class<? extends Function>` | `getFunctionClass(java.lang.String className)`
    `static java.lang.String[]` | `getFunctionNames()`
    `java.lang.String` | `getRawParameters()` Allows the retrieval of the original String prior to it being compiled.
    `java.lang.String` | `getReferenceKey()` Return the name of your function.
    `boolean` | `hasFunction()`
    `void` | `setParameters(java.util.Collection<CompoundVariable> parameters)` A collection of the parameters used to configure your function.
    `void` | `setParameters(java.lang.String parameters)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CompoundVariable

          public CompoundVariable()

    - #### CompoundVariable

          public CompoundVariable(java.lang.String parameters)

  - ### Method Detail

    - #### execute

          public java.lang.String execute()

    - #### getRawParameters

          public java.lang.String getRawParameters()

      Allows the retrieval of the original String prior to it being compiled.
      Returns:
        String

    - #### execute

          public java.lang.String execute(SampleResult previousResult,
                                          Sampler currentSampler)

      Given the previous SampleResult and the current Sampler, return a string to use as a replacement value for the function call. Assume "setParameter" was previously called. This method must be threadsafe - multiple threads will be using the same object.
      Specified by:
        `execute` in interface `Function`
      Parameters:
        `previousResult` - The previous `SampleResult`
        `currentSampler` - The current `Sampler`
      Returns:
        The replacement value, which was generated by the function

    - #### getFunction

          public CompoundVariable getFunction()

    - #### getArgumentDesc

          public java.util.List<java.lang.String> getArgumentDesc()

      Return a list of strings briefly describing each parameter your function takes. Please use JMeterUtils.getResString(resource_name) to grab a resource string. Otherwise, your help text will be difficult to internationalize. This list is not optional. If you don't wish to write help, you must at least return a List containing the correct number of blank strings, one for each argument.
      Specified by:
        `getArgumentDesc` in interface `Function`
      Returns:
        List with brief descriptions for each parameter the function takes

    - #### clear

          public void clear()

    - #### setParameters

          public void setParameters(java.lang.String parameters)
                             throws InvalidVariableException

      Throws:
        `InvalidVariableException`

    - #### getFunctionClass

          public static java.lang.Class<? extends Function> getFunctionClass(java.lang.String className)

    - #### getFunctionNames

          public static java.lang.String[] getFunctionNames()

    - #### hasFunction

          public boolean hasFunction()

    - #### getReferenceKey

          public java.lang.String getReferenceKey()

      Return the name of your function. Convention is to prepend "__" to the name (ie "__regexFunction")
      Specified by:
        `getReferenceKey` in interface `Function`
      Returns:
        The name of the function

    - #### setParameters

          public void setParameters(java.util.Collection<CompoundVariable> parameters)
                             throws InvalidVariableException

      A collection of the parameters used to configure your function. Each parameter is a CompoundVariable and can be resolved by calling the execute() method of the CompoundVariable (which should be done at execution.)
      Specified by:
        `setParameters` in interface `Function`
      Parameters:
        `parameters` - The parameters for the function call
      Throws:
        `InvalidVariableException` - - when the variables for the function call can't be evaluated

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.