Class MeterTag

java.lang.Object
com.atlassian.diagnostics.ipd.api.MeterTag

public class MeterTag extends Object
Represents a tag for a meter. A tag consists of a key-value pair, where both the key and value are strings. This class provides methods to retrieve the key and value, as well as to format the tag. Use the of(String, String) method to create a new MeterTag.
Since:
5.0.0
  • Method Details

    • getKey

      public String getKey()
    • getValue

      public String getValue()
    • getFormattedTag

      public MeterTag getFormattedTag()
      Returns a new MeterTag with the key and value formatted to replace spaces with underscores. This is useful for displaying the tag in JMX and log files.
      Returns:
      a new MeterTag with the key and value formatted to replace spaces with underscores
    • of

      public static MeterTag of(String key, String value)
      Creates a new MeterTag with the given key and value.
      Parameters:
      key - the key of the tag
      value - the value of the tag
      Returns:
      a new MeterTag with the given key and value
    • 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