Metrics2Util.NameValuePair (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.metrics2.util, class: Metrics2Util, class: NameValuePair

Package org.apache.hadoop.metrics2.util

# Class Metrics2Util.NameValuePair

java.lang.Object
org.apache.hadoop.metrics2.util.Metrics2Util.NameValuePair

All Implemented Interfaces:
  `Comparable<Metrics2Util.NameValuePair>`

Enclosing class:
  Metrics2Util

@Private public static class Metrics2Util.NameValuePair extends Object implements Comparable<Metrics2Util.NameValuePair>
A pair of a name and its corresponding value. Defines a custom comparator so the TopN PriorityQueue sorts based on the count.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NameValuePair(String metricName, long value)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(Metrics2Util.NameValuePair other)`
  `boolean`
  `equals(Object other)`
  `String`
  `getName()`
  `long`
  `getValue()`
  `int`
  `hashCode()`

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

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

- ## Constructor Details

  - ### NameValuePair

    public NameValuePair(String metricName, long value)

- ## Method Details

  - ### getName

    public String getName()

  - ### getValue

    public long getValue()

  - ### compareTo

    public int compareTo(Metrics2Util.NameValuePair other)
    Specified by:
      `compareTo` in interface `Comparable<Metrics2Util.NameValuePair>`

  - ### equals

    public boolean equals(Object other)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`