Package org.eclipse.microprofile.metrics
Class MetadataBuilder
- java.lang.Object
-
- org.eclipse.microprofile.metrics.MetadataBuilder
-
public class MetadataBuilder extends java.lang.Object
TheMetadata
builder. This builder has a default value:type
asMetricType.INVALID
unit
asMetricUnits.NONE
reusable
asBoolean.FALSE
-
-
Constructor Summary
Constructors Constructor Description MetadataBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Metadata
build()
MetadataBuilder
notReusable()
Sets the reusability flag toBoolean.FALSE
MetadataBuilder
reusable()
Sets the reusability flag toBoolean.TRUE
MetadataBuilder
reusable(boolean value)
Sets the reusability flag to the desired boolean valueMetadataBuilder
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
withOptionalDescription(java.lang.String description)
Sets the description.MetadataBuilder
withOptionalDisplayName(java.lang.String displayName)
Sets the displayName.MetadataBuilder
withOptionalType(MetricType type)
Sets the type.MetadataBuilder
withOptionalUnit(java.lang.String unit)
Sets the unit.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 null
-
withDisplayName
public MetadataBuilder withDisplayName(java.lang.String displayName)
Sets the displayName. Does not accept null.- Parameters:
displayName
- the displayName- Returns:
- the builder instance
- Throws:
java.lang.NullPointerException
- when displayName is null
-
withOptionalDisplayName
public MetadataBuilder withOptionalDisplayName(java.lang.String displayName)
Sets the displayName. Does accept null.- Parameters:
displayName
- the displayName- Returns:
- the builder instance
-
withDescription
public MetadataBuilder withDescription(java.lang.String description)
Sets the description. Does not accept null.- Parameters:
description
- the name- Returns:
- the builder instance
- Throws:
java.lang.NullPointerException
- when description is null
-
withOptionalDescription
public MetadataBuilder withOptionalDescription(java.lang.String description)
Sets the description. Does accept null.- Parameters:
description
- the name- Returns:
- the builder instance
-
withType
public MetadataBuilder withType(MetricType type)
Sets the type. Does not accept null.- Parameters:
type
- the type- Returns:
- the builder instance
- Throws:
java.lang.NullPointerException
- when type is null
-
withOptionalType
public MetadataBuilder withOptionalType(MetricType type)
Sets the type. Does accept null.- Parameters:
type
- the type- Returns:
- the builder instance
-
withUnit
public MetadataBuilder withUnit(java.lang.String unit)
Sets the unit. Does not accept null.- Parameters:
unit
- the unit- Returns:
- the builder instance
- Throws:
java.lang.NullPointerException
- when unit is null
-
withOptionalUnit
public MetadataBuilder withOptionalUnit(java.lang.String unit)
Sets the unit. Does accept null.- Parameters:
unit
- the unit- Returns:
- the builder instance
-
reusable
public MetadataBuilder reusable()
Sets the reusability flag toBoolean.TRUE
- Returns:
- the builder instance
-
reusable
public MetadataBuilder reusable(boolean value)
Sets the reusability flag to the desired boolean value- Parameters:
value
- the value of the reusability flag- Returns:
- the builder instance
-
notReusable
public MetadataBuilder notReusable()
Sets the reusability flag toBoolean.FALSE
- Returns:
- the builder instance
-
-