org.eclipse.microprofile.metrics

## Class Tag

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

    public class Tag
    extends Object

Tag represents a singular metric tag key and value pair. The Tag contains:

- `TagName`: (Required) The name of the tag. Must match the regex [a-zA-Z_][a-zA-Z0-9_]*.
- `TagValue`: (Required) The value of the tag.

### Constructor Summary

Constructors
Constructor and Description
`Tag(String tagName, String tagValue)` Constructs the Tag object with the given tag name and tag value

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`String` `getTagName()`
`String` `getTagValue()`
`int` `hashCode()`
`String` `toString()`

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

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

### Constructor Detail

#### Tag

    public Tag(String tagName,
               String tagValue)
        throws IllegalArgumentException

Constructs the Tag object with the given tag name and tag value

Parameters:
  `tagName` - The tag name, must match the regex [a-zA-Z_][a-zA-Z0-9_]*.
  `tagValue` - The tag value
Throws:
  `IllegalArgumentException` - If the tagName does not match [a-zA-Z_][a-zA-Z0-9_]*

### Method Detail

#### getTagName

    public String getTagName()

Returns:
  the tagName

#### getTagValue

    public String getTagValue()

Returns:
  the tagValue

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`