Package org.eclipse.microprofile.metrics
Class MetadataBuilder
- java.lang.Object
-
- org.eclipse.microprofile.metrics.MetadataBuilder
-
public class MetadataBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MetadataBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Metadata
build()
MetadataBuilder
withDescription(java.lang.String description)
Sets the description.MetadataBuilder
withDisplayName(java.lang.String displayName)
Sets the displayName.MetadataBuilder
withName(java.lang.String name)
Sets the name.MetadataBuilder
withType(MetricType type)
Sets the type.MetadataBuilder
withUnit(java.lang.String unit)
Sets the unit.
-
-
-
Method Detail
-
withName
public MetadataBuilder withName(java.lang.String name)
Sets the name. Does not accept null.- Parameters:
name
- the name- Returns:
- the builder instance
- Throws:
java.lang.NullPointerException
- when name is nulljava.lang.IllegalArgumentException
- when name is empty
-
withDisplayName
public MetadataBuilder withDisplayName(java.lang.String displayName)
Sets the displayName.- Parameters:
displayName
- the displayName, empty string is considered as "not present" (null)- Returns:
- the builder instance
-
withDescription
public MetadataBuilder withDescription(java.lang.String description)
Sets the description.- Parameters:
description
- the name, empty string is considered as "not present" (null)- Returns:
- the builder instance
-
withType
public MetadataBuilder withType(MetricType type)
Sets the type.- Parameters:
type
- the type,MetricType.INVALID
is considered as "not present" (null)- Returns:
- the builder instance
-
withUnit
public MetadataBuilder withUnit(java.lang.String unit)
Sets the unit.- Parameters:
unit
- the unit,MetricUnits.NONE
is considered as "not present" (null)- Returns:
- the builder instance
-
-