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 |
withDisplayName(java.lang.String displayName)
Sets the displayName.
|
MetadataBuilder |
withName(java.lang.String name)
Sets the name.
|
MetadataBuilder |
withType(MetricType type)
Sets the type.
|
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 withDisplayName(java.lang.String displayName)
displayName
- the displayName, empty string is considered as "not present" (null)public MetadataBuilder withDescription(java.lang.String description)
description
- the name, empty string is considered as "not present" (null)public MetadataBuilder withType(MetricType type)
type
- the type, MetricType.INVALID
is considered as "not present" (null)public MetadataBuilder withUnit(java.lang.String unit)
unit
- the unit, MetricUnits.NONE
is considered as "not present" (null)