public class MetadataBuilder extends Object
Metadata builder.
This builder has a default value:
type as MetricType.INVALID
unit as MetricUnits.NONE
reusable as Boolean.FALSE| Constructor and Description |
|---|
MetadataBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Metadata |
build() |
MetadataBuilder |
notReusable()
Sets the reusability flag to
Boolean.FALSE |
MetadataBuilder |
reusable()
Sets the reusability flag to
Boolean.TRUE |
MetadataBuilder |
reusable(boolean value)
Sets the reusability flag to the desired boolean value
|
MetadataBuilder |
withDescription(String description)
Sets the description.
|
MetadataBuilder |
withDisplayName(String displayName)
Sets the displayName.
|
MetadataBuilder |
withName(String name)
Sets the name.
|
MetadataBuilder |
withOptionalDescription(String description)
Sets the description.
|
MetadataBuilder |
withOptionalDisplayName(String displayName)
Sets the displayName.
|
MetadataBuilder |
withOptionalType(MetricType type)
Sets the type.
|
MetadataBuilder |
withOptionalUnit(String unit)
Sets the unit.
|
MetadataBuilder |
withType(MetricType type)
Sets the type.
|
MetadataBuilder |
withUnit(String unit)
Sets the unit.
|
public MetadataBuilder withName(String name)
name - the nameNullPointerException - when name is nullpublic MetadataBuilder withDisplayName(String displayName)
displayName - the displayNameNullPointerException - when displayName is nullpublic MetadataBuilder withOptionalDisplayName(String displayName)
displayName - the displayNamepublic MetadataBuilder withDescription(String description)
description - the nameNullPointerException - when description is nullpublic MetadataBuilder withOptionalDescription(String description)
description - the namepublic MetadataBuilder withType(MetricType type)
type - the typeNullPointerException - when type is nullpublic MetadataBuilder withOptionalType(MetricType type)
type - the typepublic MetadataBuilder withUnit(String unit)
unit - the unitNullPointerException - when unit is nullpublic MetadataBuilder withOptionalUnit(String unit)
unit - the unitpublic MetadataBuilder reusable()
Boolean.TRUEpublic MetadataBuilder reusable(boolean value)
value - the value of the reusability flagpublic MetadataBuilder notReusable()
Boolean.FALSEpublic Metadata build()
Metadata from the provided propertiesIllegalStateException - when either name is nullCopyright © 2020. All rights reserved.