Top Description Fields Constructors Methods
org.eclipse.microprofile.metrics

public Class MetadataBuilder

extends Object
Class Inheritance
Imports
java.util.Objects

The Metadata builder. All values are considered "not present" by default. Name must be set before build() is called.

Field Summary

Modifier and TypeField and Description
private String
private String
private String

Constructor Summary

AccessConstructor and Description
pack-priv
public

Method Summary

Modifier and TypeMethod and Description
public Metadata

Returns:

An object implementing Metadata from the provided properties
build
()

public MetadataBuilder

Returns:

the builder instance
withDescription
(String
the name, empty string is considered as "not present" (null)
description
)

Sets the description.

public MetadataBuilder

Returns:

the builder instance
withName
(String
the name
name
)

Sets the name.

public MetadataBuilder

Returns:

the builder instance
withUnit
(String
the unit, MetricUnits#NONE is considered as "not present" (null)
unit
)

Sets the unit.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

descriptionback to summary
private String description
nameback to summary
private String name
unitback to summary
private String unit

Constructor Detail

MetadataBuilderback to summary
pack-priv MetadataBuilder(Metadata metadata)
MetadataBuilderback to summary
public MetadataBuilder()

Method Detail

buildback to summary
public Metadata build()
Returns:Metadata

An object implementing Metadata from the provided properties

Exceptions
IllegalStateException:
when either name is null
withDescriptionback to summary
public MetadataBuilder withDescription(String description)

Sets the description.

Parameters
description:String

the name, empty string is considered as "not present" (null)

Returns:MetadataBuilder

the builder instance

withNameback to summary
public MetadataBuilder withName(String name)

Sets the name. Does not accept null.

Parameters
name:String

the name

Returns:MetadataBuilder

the builder instance

Exceptions
NullPointerException:
when name is null
IllegalArgumentException:
when name is empty
withUnitback to summary
public MetadataBuilder withUnit(String unit)

Sets the unit.

Parameters
unit:String

the unit, MetricUnits#NONE is considered as "not present" (null)

Returns:MetadataBuilder

the builder instance