public class SampleBuilder extends Object
It provides default behaviour for number formatting.
The default numberformat used is a DecimalFormat whose pattern is the
following :
"#########0.00#"
Constructor and Description |
---|
SampleBuilder(SampleMetadata metadata)
Construct a SampleBuilder with default formatter
|
SampleBuilder(SampleMetadata metadata,
NumberFormat floatFormatter)
Construct a SampleBuilder.
|
Modifier and Type | Method and Description |
---|---|
SampleBuilder |
add(double e) |
SampleBuilder |
add(long e) |
SampleBuilder |
add(String e) |
Sample |
build() |
SampleMetadata |
getMetadata() |
public SampleBuilder(SampleMetadata metadata, NumberFormat floatFormatter)
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.)public SampleBuilder(SampleMetadata metadata)
metadata
- the details about expected sample data (must not be null
)public final SampleMetadata getMetadata()
public SampleBuilder add(String e)
public SampleBuilder add(long e)
public SampleBuilder add(double e)
public Sample build()
Copyright (c) 1998-2021 Apache Software Foundation. All Rights Reserved.