org.apache.solr.handler.component

## Class PivotFacetValue

- java.lang.Object
- - org.apache.solr.handler.component.PivotFacetValue

-     public class PivotFacetValue
      extends Object

  Models a single (value, count) pair that will exist in the collection of values for a `PivotFacetField` parent. This `PivotFacetValue` may itself have a nested `PivotFacetField` child
  See Also:
    `PivotFacetField`, `PivotFacetFieldValueCollection`

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `NamedList<Object>` | `convertToNamedList()` A recursive method for generating a NamedList from this value suitable for including in a pivot facet response to the original distributed request.
    `static PivotFacetValue` | `createFromNamedList(int shardNumber, ResponseBuilder rb, PivotFacetField parentField, NamedList<Object> pivotData)` A recursive method to construct a new `PivotFacetValue` object from the contents of the `NamedList` provided by the specified shard, relative to the specified field.
    `PivotFacetField` | `getChildPivot()` The `PivotFacetField` corrisponding to the nested child pivot for this `PivotFacetValue`.
    `int` | `getCount()` The count corrisponding to the value modeled by this `PivotFacetValue`
    `Comparable` | `getValue()` The value of the asssocated field modeled by this `PivotFacetValue`.
    `List<String>` | `getValuePath()` A recursive method that walks up the tree of pivot fields/values to build a list of the String representations of the values that lead down to this PivotFacetValue.
    `void` | `mergeContributionFromShard(int shardNumber, ResponseBuilder rb, NamedList<Object> value)` Merges in the count contributions from the specified shard for each.
    `boolean` | `shardHasContributed(int shardNum)` A NON-Recursive method indicating if the specified shard has already contributed to the count for this value.
    `String` | `toString()`

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

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

- - ### Method Detail

    - #### getValue

          public Comparable getValue()

      The value of the asssocated field modeled by this `PivotFacetValue`. May be null if this `PivotFacetValue` models the count for docs "missing" the field value.
      See Also:
        `FacetParams.FACET_MISSING`

    - #### getCount

          public int getCount()

      The count corrisponding to the value modeled by this `PivotFacetValue`

    - #### getChildPivot

          public PivotFacetField getChildPivot()

      The `PivotFacetField` corrisponding to the nested child pivot for this `PivotFacetValue`. May be null if this object is the leaf of a pivot.

    - #### getValuePath

          public List<String> getValuePath()

      A recursive method that walks up the tree of pivot fields/values to build a list of the String representations of the values that lead down to this PivotFacetValue.
      Returns:
        a mutable List of the pivot value Strings leading down to and including this pivot value, will never be null but may contain nulls
      See Also:
        `PivotFacetField.getValuePath()`

    - #### createFromNamedList

          public static PivotFacetValue createFromNamedList(int shardNumber,
                                                            ResponseBuilder rb,
                                                            PivotFacetField parentField,
                                                            NamedList<Object> pivotData)

      A recursive method to construct a new `PivotFacetValue` object from the contents of the `NamedList` provided by the specified shard, relative to the specified field. If the `NamedList` contains data for a child `PivotFacetField` that will be recursively built as well.
      Parameters:
        `shardNumber` - the id of the shard that provided this data
        `rb` - The response builder of the current request
        `parentField` - the parent field in the current pivot associated with this value
        `pivotData` - the data from the specified shard for this pivot value
      See Also:
        `PivotFacetField.createFromListOfNamedLists(int, org.apache.solr.handler.component.ResponseBuilder, org.apache.solr.handler.component.PivotFacetValue, java.util.List<org.apache.solr.common.util.NamedList<java.lang.Object>>)`

    - #### shardHasContributed

          public boolean shardHasContributed(int shardNum)

      A NON-Recursive method indicating if the specified shard has already contributed to the count for this value.

    - #### convertToNamedList

          public NamedList<Object> convertToNamedList()

      A recursive method for generating a NamedList from this value suitable for including in a pivot facet response to the original distributed request.
      See Also:
        `PivotFacetField.convertToListOfNamedLists()`

    - #### mergeContributionFromShard

          public void mergeContributionFromShard(int shardNumber,
                                                 ResponseBuilder rb,
                                                 NamedList<Object> value)

      Merges in the count contributions from the specified shard for each. This method is recursive if the shard data includes sub-pivots
      See Also:
        `PivotFacetField.contributeFromShard(int, org.apache.solr.handler.component.ResponseBuilder, java.util.List<org.apache.solr.common.util.NamedList<java.lang.Object>>)`, `PivotFacetField.createFromListOfNamedLists(int, org.apache.solr.handler.component.ResponseBuilder, org.apache.solr.handler.component.PivotFacetValue, java.util.List<org.apache.solr.common.util.NamedList<java.lang.Object>>)`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.