Class Facet

    • Field Detail

      • name

        private String name
        Facet name, for example "Location"
      • unselectAllUrl

        private String unselectAllUrl
        URL to use to unselect all possible values of this facet, built from the current URL

        The URL is one where the facet is not selected, the URL may be used as the base URL to append to select values within the facet.

        sSince 15.12
      • customData

        private final Map<String,​Object> customData
        Custom data placeholder allowing any arbitrary data to be stored for this facet by hook scripts.
      • selectionType

        @NotNull
        @NonNull
        private @NotNull @NonNull FacetSelectionType selectionType
        Since:
        15.12
      • constraintJoin

        @NotNull
        @NonNull
        private @NotNull @NonNull FacetConstraintJoin constraintJoin
        Since:
        15.12
      • facetValues

        @NotNull
        @NonNull
        private @NotNull @NonNull FacetValues facetValues
        Since:
        15.12
      • guessedDisplayType

        @NotNull
        @NonNull
        private @NotNull @NonNull FacetDisplayType guessedDisplayType
        The guessed type of the facet based on its configuration.

        This value can give an indication of how the facet should be displayed, for example SINGLE select where values come from a UNSCOPED query would give the value RADIO_BUTTON. The UI could use this to show the facets as radio buttons.

        If the guessedType is not the way you intend to show the facet you should ignore this value and instead use the facet name or other fields which describe the facet to work out what should be shown i.e. don't have code which is if(guessedType == TAB) then show the facet as checkboxes.

        Newer versions of Funnelback may change how the type is guessed.

        Since:
        15.12
      • customComparator

        private Comparator<Facet.CategoryValue> customComparator
        If non-null this comparator will be used to sort values returned by the Facet#getAllValues(), getSelectedValues() and Facet#getUnselectAllUrl() methods.

        This currently does not sort the values returned by any other method such as the values in what is returned by Facet#getAllValues() although this may change.

        Since:
        15.12
      • allValues

        private final List<Facet.CategoryValue> allValues
        List of all facet values both selected and unselected.
        Since:
        15.12
    • Method Detail

      • getSelectedValues

        public List<Facet.CategoryValue> getSelectedValues()
        Returns:
        List of selected values, useful to build breadcrumbs
        Since:
        15.12
      • hasValues

        public boolean hasValues()
        Recursively check if this facet has any value at all.
        Returns:
        true if the facet possess at least one value.
      • ofNullableSingle

        public static <T> Stream<T> ofNullableSingle​(T a)
        Clone from com.funnelback.common.function.StreamUtils.ofNullableSingle(T)
      • isSelected

        public boolean isSelected()
        Returns:
        True if any of the values of this facet is selected
        Since:
        15.12