org.hibernate.search.query.dsl.impl

## Class FacetingRequestImpl

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

- All Implemented Interfaces:
    FacetingRequest
  Direct Known Subclasses:
    DiscreteFacetRequest, RangeFacetRequest

      public abstract class FacetingRequestImpl
      extends Object
      implements FacetingRequest

  Base class for faceting requests.
  Author:
    Hardy Ferentschik

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FacetingRequestImpl(String name, String fieldName)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract Facet` | `createFacet(FacetMetadata facetMetadata, String value, int count)`
    `String` | `getFacetingName()`
    `abstract Class<?>` | `getFacetValueType()`
    `String` | `getFieldName()`
    `int` | `getMaxNumberOfFacets()`
    `FacetSortOrder` | `getSort()`
    `boolean` | `hasZeroCountsIncluded()`
    `void` | `setIncludeZeroCounts(boolean includeZeroCounts)`
    `void` | `setMaxNumberOfFacets(int maxNumberOfFacets)`
    `void` | `setSort(FacetSortOrder sort)`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### FacetingRequestImpl

          public FacetingRequestImpl(String name,
                                     String fieldName)

  - ### Method Detail

    - #### getFacetingName

          public String getFacetingName()

      Specified by:
        `getFacetingName` in interface `FacetingRequest`
      Returns:
        the name of this faceting request. The faceting name can be an arbitrary string.

    - #### getFieldName

          public String getFieldName()

      Specified by:
        `getFieldName` in interface `FacetingRequest`
      Returns:
        the name of the facet field this faceting request is defined on

    - #### setSort

          public void setSort(FacetSortOrder sort)

    - #### getSort

          public FacetSortOrder getSort()

      Specified by:
        `getSort` in interface `FacetingRequest`
      Returns:
        the sort order of the returned `Facet`s for this request

    - #### getMaxNumberOfFacets

          public int getMaxNumberOfFacets()

      Specified by:
        `getMaxNumberOfFacets` in interface `FacetingRequest`
      Returns:
        the maximum number of facets returned for this request

    - #### setMaxNumberOfFacets

          public void setMaxNumberOfFacets(int maxNumberOfFacets)

    - #### getFacetValueType

          public abstract Class<?> getFacetValueType()

      Returns:
        the field value type on which the facets applies. This determines which type of facet query one needs to build.

    - #### createFacet

          public abstract Facet createFacet(FacetMetadata facetMetadata,
                                            String value,
                                            int count)

    - #### hasZeroCountsIncluded

          public boolean hasZeroCountsIncluded()

      Specified by:
        `hasZeroCountsIncluded` in interface `FacetingRequest`
      Returns:
        `true` if facets with a count of 0 should be included in the returned facet list

    - #### setIncludeZeroCounts

          public void setIncludeZeroCounts(boolean includeZeroCounts)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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