LabelAndValue (Lucene 10.5.1 facet API)
Description: declaration: package: org.apache.lucene.facet, class: LabelAndValue

Package org.apache.lucene.facet

# Class LabelAndValue

java.lang.Object
org.apache.lucene.facet.LabelAndValue

public final class LabelAndValue extends Object
Single label and its value, usually contained in a `FacetResult`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final int`
  `count`
  Number of occurrences for this label.
  `final String`
  `label`
  Facet's label.
  `final Number`
  `value`
  Value associated with this label.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LabelAndValue(String label, Number value)`
  Constructor with unspecified count, we assume the value is a count.
  `LabelAndValue(String label, Number value, int count)`
  Constructor with value and count.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object _other)`
  `int`
  `hashCode()`
  `String`
  `toString()`

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

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

- ## Field Details

  - ### label

    public final String label
    Facet's label.

  - ### value

    public final Number value
    Value associated with this label.

  - ### count

    public final int count
    Number of occurrences for this label.

- ## Constructor Details

  - ### LabelAndValue

    public LabelAndValue(String label, Number value)
    Constructor with unspecified count, we assume the value is a count.

  - ### LabelAndValue

    public LabelAndValue(String label, Number value, int count)
    Constructor with value and count.

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### equals

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

  - ### hashCode

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