org.apache.jmeter.report.core

## Class SampleBuilder

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

-     public class SampleBuilder
      extends Object

  This class is meant to simplify the building of samples.

  It provides default behaviour for number formatting.
  The default numberformat used is a DecimalFormat whose pattern is the following :
  `"#########0.00#"`

  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SampleBuilder(SampleMetadata metadata)` Construct a SampleBuilder with default formatter
    `SampleBuilder(SampleMetadata metadata, NumberFormat floatFormatter)` Construct a SampleBuilder.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SampleBuilder` | `add(double e)`
    `SampleBuilder` | `add(long e)`
    `SampleBuilder` | `add(String e)`
    `Sample` | `build()`
    `SampleMetadata` | `getMetadata()`

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

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

- - ### Constructor Detail

    - #### SampleBuilder

          public SampleBuilder(SampleMetadata metadata,
                               NumberFormat floatFormatter)

      Construct a SampleBuilder.
      Parameters:
        `metadata` - the details about expected sample data (must not be `null`)
        `floatFormatter` - the formatter to be used (the default formatter will be used, if `null` is given.)

    - #### SampleBuilder

          public SampleBuilder(SampleMetadata metadata)

      Construct a SampleBuilder with default formatter
      Parameters:
        `metadata` - the details about expected sample data (must not be `null`)

  - ### Method Detail

    - #### getMetadata

          public final SampleMetadata getMetadata()

      Returns:
        the metadata

    - #### add

          public SampleBuilder add(String e)

    - #### add

          public SampleBuilder add(long e)

    - #### add

          public SampleBuilder add(double e)

    - #### build

          public Sample build()

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