Package org.eclipse.microprofile.metrics
Interface Metadata
- All Known Implementing Classes:
DefaultMetadata
public interface Metadata
Bean holding the metadata of one single metric.
The metadata contains:
Name: (Required) The name of the metric.Description: (Optional) A human readable description of the metric.Unit: (Optional) The unit of the metric. The unit may be any unit specified as a String or one specified inMetricUnits.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MetadataBuilderbuilder()Returns a new builderstatic MetadataBuilderReturns a new builder with theMetadatainformationReturns the description of the metric if set, otherwise this method returns the emptyString.getName()Returns the metric name.getUnit()Returns the unit of this metric if set, otherwise this method returnsMetricUnits.NONEunit()
-
Method Details
-
getName
String getName()Returns the metric name.- Returns:
- the metric name.
-
getDescription
String getDescription()Returns the description of the metric if set, otherwise this method returns the emptyString.- Returns:
- the description
-
description
-
getUnit
String getUnit()Returns the unit of this metric if set, otherwise this method returnsMetricUnits.NONE- Returns:
- the unit
-
unit
-
builder
Returns a new builder- Returns:
- a new
MetadataBuilderinstance
-
builder
Returns a new builder with theMetadatainformation- Parameters:
metadata- the metadata- Returns:
- a new
MetadataBuilderinstance with theMetadatavalues - Throws:
NullPointerException- when metadata is null
-