org.hibernate.search.query.dsl.impl

## Class AbstractFacet

- java.lang.Object
- - org.hibernate.search.query.dsl.impl.AbstractFacet

- All Implemented Interfaces:
    Facet
  Direct Known Subclasses:
    RangeFacetImpl

      public abstract class AbstractFacet
      extends Object
      implements Facet

  A single facet (field value and count).
  Author:
    Hardy Ferentschik

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractFacet(String facetingName, String facetFieldName, String sourceFieldName, String value, int count)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `int` | `getCount()`
    `String` | `getFacetFieldName()`
    `String` | `getFacetingName()`
    `abstract Query` | `getFacetQuery()`
    `String` | `getFieldName()` Deprecated. Use `getFacetFieldName()` instead.
    `String` | `getSourceFieldName()`
    `String` | `getValue()`
    `int` | `hashCode()`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### AbstractFacet

          public AbstractFacet(String facetingName,
                               String facetFieldName,
                               String sourceFieldName,
                               String value,
                               int count)

  - ### Method Detail

    - #### getCount

          public int getCount()

      Specified by:
        `getCount` in interface `Facet`
      Returns:
        the facet count.

    - #### getValue

          public String getValue()

      Specified by:
        `getValue` in interface `Facet`
      Returns:
        the value of this facet. In case of a discrete facet it is the actual `Document` field value. In case of a range query the value is a string representation of the range.

    - #### getFieldName

          @Deprecated
          public String getFieldName()

      Deprecated. Use `getFacetFieldName()` instead.
      Description copied from interface: `Facet`
      Return the `Document` field name this facet is targeting. The field needs to be indexed with `Analyze.NO`.
      Specified by:
        `getFieldName` in interface `Facet`
      Returns:
        the `Document` field name this facet is targeting.

    - #### getFacetFieldName

          public String getFacetFieldName()

    - #### getSourceFieldName

          public String getSourceFieldName()

    - #### getFacetingName

          public String getFacetingName()

      Specified by:
        `getFacetingName` in interface `Facet`
      Returns:
        the faceting name this `Facet` belongs to.
      See Also:
        `FacetingRequest.getFacetingName()`

    - #### getFacetQuery

          public abstract Query getFacetQuery()

      Specified by:
        `getFacetQuery` in interface `Facet`
      Returns:
        a Lucene `Query` which which can be executed to retrieve all documents matching the value of this facet.

    - #### 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`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved