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 |
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 withDescription(String description)
description
- the nameNullPointerException
- when description is nullpublic MetadataBuilder withType(MetricType type)
type
- the nameNullPointerException
- when type is nullpublic MetadataBuilder withUnit(String unit)
unit
- the nameNullPointerException
- when unit is nullpublic MetadataBuilder reusable()
Boolean.TRUE
public MetadataBuilder reusable(boolean value)
value
- the value of the reusability flagpublic MetadataBuilder notReusable()
Boolean.FALSE
public Metadata build()
Metadata
from the provided propertiesIllegalStateException
- when either name is nullCopyright © 2021. All rights reserved.