Class FacetComparatorProvider
- java.lang.Object
-
- com.funnelback.publicui.search.model.transaction.facet.order.FacetComparatorProvider
-
public class FacetComparatorProvider extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
FacetComparatorProvider.AsIsComparator
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<com.funnelback.common.facetednavigation.models.FacetValuesOrder,java.util.Comparator<Facet.CategoryValue>>
FACET_ORDER_TO_COMPARATOR
-
Constructor Summary
Constructors Constructor Description FacetComparatorProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.util.Comparator<Facet.CategoryValue>
getComparator(com.funnelback.common.facetednavigation.models.FacetValuesOrder orderToSortBy, java.util.Optional<java.util.Comparator<Facet.CategoryValue>> customComparator)
java.util.Comparator<Facet.CategoryValue>
getComparatorWhenSortingAllValus(java.util.List<com.funnelback.common.facetednavigation.models.FacetValuesOrder> ordersToSortBy, java.util.Optional<java.util.Comparator<Facet.CategoryValue>> customComparator)
Gets the comparator to use when we are sorting on ALL category values.java.util.Comparator<Facet.CategoryValue>
getComparatorWhenSortingValuesFromSingleCategory(java.util.List<com.funnelback.common.facetednavigation.models.FacetValuesOrder> ordersToSortBy)
This is the comparator to use when we are sorting values that come from a Single CategoryDefinition.(package private) java.util.Comparator<Facet.CategoryValue>
makeComparatorChain(java.util.List<com.funnelback.common.facetednavigation.models.FacetValuesOrder> ordersToSortBy, java.util.Optional<java.util.Comparator<Facet.CategoryValue>> customComparator)
Creates a comparator by chaining the wanted comparators.
-
-
-
Field Detail
-
FACET_ORDER_TO_COMPARATOR
private final java.util.Map<com.funnelback.common.facetednavigation.models.FacetValuesOrder,java.util.Comparator<Facet.CategoryValue>> FACET_ORDER_TO_COMPARATOR
-
-
Method Detail
-
getComparator
java.util.Comparator<Facet.CategoryValue> getComparator(com.funnelback.common.facetednavigation.models.FacetValuesOrder orderToSortBy, java.util.Optional<java.util.Comparator<Facet.CategoryValue>> customComparator)
-
makeComparatorChain
java.util.Comparator<Facet.CategoryValue> makeComparatorChain(java.util.List<com.funnelback.common.facetednavigation.models.FacetValuesOrder> ordersToSortBy, java.util.Optional<java.util.Comparator<Facet.CategoryValue>> customComparator)
Creates a comparator by chaining the wanted comparators.- Parameters:
ordersToSortBy
- The list describing the comparators wanted.- Returns:
-
getComparatorWhenSortingValuesFromSingleCategory
public java.util.Comparator<Facet.CategoryValue> getComparatorWhenSortingValuesFromSingleCategory(java.util.List<com.funnelback.common.facetednavigation.models.FacetValuesOrder> ordersToSortBy)
This is the comparator to use when we are sorting values that come from a Single CategoryDefinition.This one needs to ensure that even caparators that come after CATEGORY_DEFINITION_ORDER are used as we are comparing within the category definition.
- Parameters:
ordersToSortBy
-- Returns:
-
getComparatorWhenSortingAllValus
public java.util.Comparator<Facet.CategoryValue> getComparatorWhenSortingAllValus(java.util.List<com.funnelback.common.facetednavigation.models.FacetValuesOrder> ordersToSortBy, java.util.Optional<java.util.Comparator<Facet.CategoryValue>> customComparator)
Gets the comparator to use when we are sorting on ALL category values. This comparator is expected to be able to sort values from all sources (ie all category definitions). In this case we need to be careful to ensure that sorting by CATEGORY_DEFINITION_ORDER still works.- Parameters:
ordersToSortBy
-- Returns:
-
-