Package org.apache.jmeter.report.processor

# Class AbstractSampleProcessor

java.lang.Object
org.apache.jmeter.report.processor.AbstractSampleProcessor

All Implemented Interfaces:
  `SampleProcessor`

Direct Known Subclasses:
  `AbstractSampleConsumer`

public class AbstractSampleProcessor extends Object implements SampleProcessor
Base for sample processor implementations
Implements basic logic for setting sample context and handling channel attributes.

Since:
  3.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractSampleProcessor()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getChannelAttribute(int channel, String key)`
  Return an attribute value associated on a channel on this sample processor
  `SampleContext`
  `getSampleContext()`
  Gets the sample context.
  `void`
  `setChannelAttribute(int channel, String key, Object value)`
  Associate an attribute to the specified channel for this sample processor
  If the attribute already exist, it is replaced.
  `void`
  `setSampleContext(SampleContext sampleContext)`
  Set sample context that this consumer should rely on.

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

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

- ## Constructor Details

  - ### AbstractSampleProcessor

    public AbstractSampleProcessor()

- ## Method Details

  - ### getSampleContext

    public SampleContext getSampleContext()
    Description copied from interface: `SampleProcessor`
    Gets the sample context.
    Specified by:
      `getSampleContext` in interface `SampleProcessor`
    Returns:
      the sample context

  - ### setSampleContext

    public void setSampleContext(SampleContext sampleContext)
    Description copied from interface: `SampleProcessor`
    Set sample context that this consumer should rely on.
    Specified by:
      `setSampleContext` in interface `SampleProcessor`
    Parameters:
      `sampleContext` - the new sample context

  - ### setChannelAttribute

    public void setChannelAttribute(int channel, String key, Object value)
    Description copied from interface: `SampleProcessor`
    Associate an attribute to the specified channel for this sample processor
    If the attribute already exist, it is replaced.
    Specified by:
      `setChannelAttribute` in interface `SampleProcessor`
    Parameters:
      `channel` - The channel number to associate the attribute on
      `key` - The attribute key
      `value` - The attribute value to be set

  - ### getChannelAttribute

    public Object getChannelAttribute(int channel, String key)
    Description copied from interface: `SampleProcessor`
    Return an attribute value associated on a channel on this sample processor
    Specified by:
      `getChannelAttribute` in interface `SampleProcessor`
    Parameters:
      `channel` - The channel on which the attribute is associated
      `key` - The attribute key to be retrieved
    Returns:
      The attribute value or null if none is found for the specified key