public class MetadataBuilder
extends java.lang.Object
Metadata
builder.
All values are considered "not present" by default. Name must be set before build()
is called.Constructor and Description |
---|
MetadataBuilder() |
Modifier and Type | Method and Description |
---|---|
Metadata |
build() |
MetadataBuilder |
withDescription(java.lang.String description)
Sets the description.
|
MetadataBuilder |
withName(java.lang.String name)
Sets the name.
|
MetadataBuilder |
withUnit(java.lang.String unit)
Sets the unit.
|
public MetadataBuilder withName(java.lang.String name)
name
- the namejava.lang.NullPointerException
- when name is nulljava.lang.IllegalArgumentException
- when name is emptypublic MetadataBuilder withDescription(java.lang.String description)
description
- the name, empty string is considered as "not present" (null)public MetadataBuilder withUnit(java.lang.String unit)
unit
- the unit, MetricUnits.NONE
is considered as "not present" (null)