Search in sources :

Example 11 with ValueResultData

use of org.apache.jmeter.report.processor.ValueResultData in project jmeter by apache.

the class AbstractDataExporter method findValue.

/**
 * Finds a value matching the specified data name in a ResultData tree.
 * Supports only MapResultData walking.
 *
 * @param clazz
 *            the type of the value
 * @param data
 *            the name of the data containing the value
 * @param root
 *            the root of the tree
 * @param <T>
 *            type of value to be found
 * @return the value matching the data name
 */
protected static <T> T findValue(Class<T> clazz, String data, ResultData root) {
    T value = null;
    ResultData result = findData(data, root);
    if (result instanceof ValueResultData) {
        ValueResultData valueResult = (ValueResultData) result;
        Object object = valueResult.getValue();
        if (object != null && clazz.isAssignableFrom(object.getClass())) {
            value = clazz.cast(object);
        }
    }
    return value;
}
Also used : MapResultData(org.apache.jmeter.report.processor.MapResultData) ValueResultData(org.apache.jmeter.report.processor.ValueResultData) ResultData(org.apache.jmeter.report.processor.ResultData) ValueResultData(org.apache.jmeter.report.processor.ValueResultData)

Aggregations

ValueResultData (org.apache.jmeter.report.processor.ValueResultData)11 ListResultData (org.apache.jmeter.report.processor.ListResultData)6 MapResultData (org.apache.jmeter.report.processor.MapResultData)5 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 Aggregator (org.apache.jmeter.report.processor.Aggregator)1 ResultData (org.apache.jmeter.report.processor.ResultData)1 GroupInfo (org.apache.jmeter.report.processor.graph.GroupInfo)1 IndexedNameSelector (org.apache.jmeter.report.processor.graph.IndexedNameSelector)1 SeriesData (org.apache.jmeter.report.processor.graph.SeriesData)1