Package org.eclipse.microprofile.metrics

## Class DefaultMetadata

- java.lang.Object
- - org.eclipse.microprofile.metrics.DefaultMetadata

All Implemented Interfaces:
  `Metadata`

    public class DefaultMetadata
    extends Object
    implements Metadata

The default implementation of `Metadata`

### Constructor Summary

Constructors
`protected` `DefaultMetadata​(String name, String description, String unit)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Optional<String>` `description()`
`boolean` `equals​(Object o)`
`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`
`int` `hashCode()`
`String` `toString()`
`Optional<String>` `unit()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### DefaultMetadata

    protected DefaultMetadata​(String name,
                              String description,
                              String unit)

### Method Detail

#### getName

    public String getName()

Description copied from interface: `Metadata`
Returns the metric name.

Specified by:
  `getName` in interface `Metadata`
Returns:
  the metric name.

#### getDescription

    public String getDescription()

Description copied from interface: `Metadata`
Returns the description of the metric if set, otherwise this method returns the empty `String`.

Specified by:
  `getDescription` in interface `Metadata`
Returns:
  the description

#### description

    public Optional<String> description()

Specified by:
  `description` in interface `Metadata`

#### getUnit

    public String getUnit()

Description copied from interface: `Metadata`
Returns the unit of this metric if set, otherwise this method returns `MetricUnits.NONE`

Specified by:
  `getUnit` in interface `Metadata`
Returns:
  the unit

#### unit

    public Optional<String> unit()

Specified by:
  `unit` in interface `Metadata`

#### equals

    public boolean equals​(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`