Package org.eclipse.microprofile.metrics
Class MetadataBuilder
java.lang.Object
org.eclipse.microprofile.metrics.MetadataBuilder
The
Metadata
builder.
This builder has a default value:
type
as MetricType.INVALID
unit
as MetricUnits.NONE
reusable
as Boolean.FALSE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Sets the reusable toBoolean.FALSE
reusable()
Sets the reusable toBoolean.TRUE
withDescription
(String description) Sets the descriptionwithDisplayName
(String displayName) Sets the displayNameSets the namewithType
(MetricType type) Sets the typeSets the unit
-
Constructor Details
-
MetadataBuilder
public MetadataBuilder()
-
-
Method Details
-
withName
Sets the name- Parameters:
name
- the name- Returns:
- the builder instance
- Throws:
NullPointerException
- when name is null
-
withDisplayName
Sets the displayName- Parameters:
displayName
- the displayName- Returns:
- the builder instance
- Throws:
NullPointerException
- when displayName is null
-
withDescription
Sets the description- Parameters:
description
- the name- Returns:
- the builder instance
- Throws:
NullPointerException
- when description is null
-
withType
Sets the type- Parameters:
type
- the name- Returns:
- the builder instance
- Throws:
NullPointerException
- when type is null
-
withUnit
Sets the unit- Parameters:
unit
- the name- Returns:
- the builder instance
- Throws:
NullPointerException
- when unit is null
-
reusable
Sets the reusable toBoolean.TRUE
- Returns:
- the builder instance
-
notReusable
Sets the reusable toBoolean.FALSE
- Returns:
- the builder instance
-
build
- Returns:
- An object implementing
Metadata
from the provided properties - Throws:
IllegalStateException
- when either name is null
-