org.apache.jmeter.report.core

## Class SampleMetadata

- java.lang.Object
- - org.apache.jmeter.report.core.SampleMetadata

-     public class SampleMetadata
      extends java.lang.Object

  Describe samples structure by holding sample column names and theirs matching indexes.

  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SampleMetadata(char separator, java.lang.String... columns)` Builds metadata from separator character and a list of column names
    `SampleMetadata(SampleSaveConfiguration saveConfig)` Construct SampleMetaData from `SampleSaveConfiguration`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `ensureIndexOf(java.lang.String col)` Returns the index of the column with the specified name.
    `int` | `getColumnCount()`
    `java.lang.String` | `getColumnName(int i)` Gets the name of the ith column in this metadata
    `java.lang.String` | `getColumnName(java.lang.Integer i)` Gets the name of the ith column in this metadata
    `char` | `getSeparator()`
    `int` | `indexOf(java.lang.String col)` Returns the index of the column with the specified name.
    `java.lang.String` | `toString()`

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

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

- - ### Constructor Detail

    - #### SampleMetadata

          public SampleMetadata(char separator,
                                java.lang.String... columns)

      Builds metadata from separator character and a list of column names
      Parameters:
        `separator` - The character used for column separation
        `columns` - The list of columns names (must not be `null`)

    - #### SampleMetadata

          public SampleMetadata(SampleSaveConfiguration saveConfig)

      Construct SampleMetaData from `SampleSaveConfiguration`.
      Parameters:
        `saveConfig` - config from which metadata gets extracted (must not be `null`)

  - ### Method Detail

    - #### getSeparator

          public char getSeparator()

      Returns:
        the character used for separating columns

    - #### getColumnCount

          public int getColumnCount()

      Returns:
        the number of columns in the metadata

    - #### getColumnName

          public java.lang.String getColumnName(int i)

      Gets the name of the ith column in this metadata
      Parameters:
        `i` - The index of the column for which the name is requested (zero based)
      Returns:
        The column name of the ith column
      Throws:
        `java.lang.IndexOutOfBoundsException` - If the requested columln does not exist (< 0 or > `getColumnCount()`)

    - #### getColumnName

          public java.lang.String getColumnName(java.lang.Integer i)

      Gets the name of the ith column in this metadata
      Parameters:
        `i` - The index of the column for which the name is requested (zero based)
      Returns:
        The column name of the ith column
      Throws:
        `java.lang.IndexOutOfBoundsException` - If the requested columln does not exist (< 0 or > `getColumnCount()`)

    - #### indexOf

          public int indexOf(java.lang.String col)

      Returns the index of the column with the specified name.
      Parameters:
        `col` - the column name for which the index is requested
      Returns:
        The index of the requested column or -1 if the requested column does not exist in this metadata

    - #### ensureIndexOf

          public int ensureIndexOf(java.lang.String col)

      Returns the index of the column with the specified name.
      Parameters:
        `col` - the column name for which the index is requested
      Returns:
        The index of the requested column
      Throws:
        `SampleException` - when the column with the specified name is not found

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

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