Package org.eclipse.microprofile.metrics
Class MetadataBuilder
java.lang.Object
org.eclipse.microprofile.metrics.MetadataBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
withDescription
(String description) Sets the description.Sets the name.Sets the unit.
-
Constructor Details
-
MetadataBuilder
public MetadataBuilder()
-
-
Method Details
-
withName
Sets the name. Does not accept null.- Parameters:
name
- the name- Returns:
- the builder instance
- Throws:
NullPointerException
- when name is nullIllegalArgumentException
- when name is empty
-
withDescription
Sets the description.- Parameters:
description
- the name, empty string is considered as "not present" (null)- Returns:
- the builder instance
-
withUnit
Sets the unit.- Parameters:
unit
- the unit,MetricUnits.NONE
is considered as "not present" (null)- Returns:
- the builder instance
-
build
- Returns:
- An object implementing
Metadata
from the provided properties - Throws:
IllegalStateException
- when either name is null
-