Package 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
Description
`SampleBuilder(SampleMetadata metadata)`
Construct a SampleBuilder with default formatter
`SampleBuilder(SampleMetadata metadata, NumberFormat floatFormatter)`
Construct a SampleBuilder.

## Method Summary

Modifier and Type
Method
Description
`SampleBuilder`
`add(double e)`
`SampleBuilder`
`add(long e)`
`SampleBuilder`
`add(String e)`
`Sample`
`build()`
`final SampleMetadata`
`getMetadata()`

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

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

## Constructor Details

### 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 Details

### 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()