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 in `MetricUnits`.

Author:
  hrupp, Raymond Lam, Jan Bernitt

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods
`static MetadataBuilder` `builder()` Returns a new builder
`static MetadataBuilder` `builder​(Metadata metadata)` Returns a new builder with the `Metadata` information
`Optional<String>` `description()`
`String` `getDescription()` Returns the description of the metric if set, otherwise this method returns the empty `String`.
`String` `getName()` Returns the metric name.
`String` `getUnit()` Returns the unit of this metric if set, otherwise this method returns `MetricUnits.NONE`
`Optional<String>` `unit()`

### Method Detail

#### 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 empty `String`.

Returns:
  the description

#### description

    Optional<String> description()

#### getUnit

    String getUnit()

Returns the unit of this metric if set, otherwise this method returns `MetricUnits.NONE`

Returns:
  the unit

#### unit

    Optional<String> unit()

#### builder

    static MetadataBuilder builder()

Returns a new builder

Returns:
  a new `MetadataBuilder` instance

#### builder

    static MetadataBuilder builder​(Metadata metadata)

Returns a new builder with the `Metadata` information

Parameters:
  `metadata` - the metadata
Returns:
  a new `MetadataBuilder` instance with the `Metadata` values
Throws:
  `NullPointerException` - when metadata is null