Package de.cxp.ocs.util
Class DefaultLinkBuilder
java.lang.Object
de.cxp.ocs.util.DefaultLinkBuilder
- All Implemented Interfaces:
LinkBuilder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getSortingsString
(List<SortInstruction> sortings) boolean
isSortingActive
(Field sortField, SortOrder order) static String
joinParameterValues
(String... values) static String
sortStringRepresentation
(String fieldName, SortOrder order) static URI
toLink
(InternalSearchParams params) toString()
withExactFilterAsLink
(FacetConfiguration.FacetConfig facetConfig, String... filterInputValues) Returns a URL with that filter set.withFilterAsLink
(FacetConfiguration.FacetConfig facetConfig, String... filterInputValues) withFilterAsLink
(String filterName, boolean mergeValues, String... filterInputValues) Returns an URL with the specified filter(s) set.withoutFilterAsLink
(FacetConfiguration.FacetConfig facetConfig) Removes the complete filter parameter and returns the link.withoutFilterAsLink
(FacetConfiguration.FacetConfig facetConfig, String... filterValues) withoutFilterAsLink
(String filterName) Removes the complete filter parameter and returns the link.withSortingLink
(Field sortField, SortOrder sortOrder) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.cxp.ocs.util.LinkBuilder
withExactFilterAsLink
-
Field Details
-
VALUE_DELIMITER
-
VALUE_DELIMITER_ENCODED
-
SORT_DESC_PREFIX
-
-
Constructor Details
-
DefaultLinkBuilder
-
-
Method Details
-
toLink
-
withSortingLink
-
isSortingActive
-
sortStringRepresentation
-
getSortingsString
-
joinParameterValues
-
withoutFilterAsLink
public String withoutFilterAsLink(FacetConfiguration.FacetConfig facetConfig, String... filterValues) -
withoutFilterAsLink
Removes the complete filter parameter and returns the link.- Parameters:
facetConfig
- config of the facet that filters should be cleared from the current url- Returns:
- link url as string
-
withoutFilterAsLink
Removes the complete filter parameter and returns the link.- Specified by:
withoutFilterAsLink
in interfaceLinkBuilder
- Parameters:
filterName
- parameter that should be removed from the current url- Returns:
- link url as string
-
withFilterAsLink
public String withFilterAsLink(FacetConfiguration.FacetConfig facetConfig, String... filterInputValues) -
withFilterAsLink
Description copied from interface:LinkBuilder
Returns an URL with the specified filter(s) set. If that filter already exists, the values will be merged in case the mergeValues option is set in the configuration. Otherwise the values are replaced.- Specified by:
withFilterAsLink
in interfaceLinkBuilder
- Parameters:
filterName
- name of the filter to addmergeValues
- set true to merge values in case of existing filter, to replace existing values set to falsefilterInputValues
- the values the filter should have- Returns:
- the created URL
-
withExactFilterAsLink
public String withExactFilterAsLink(FacetConfiguration.FacetConfig facetConfig, String... filterInputValues) Returns a URL with that filter set. If the filter-name existed before, it will be replaced completely. No multi-select value merging will be done.
This method moves the responsibility of value-joining to the caller
- Parameters:
facetConfig
- config of the facet that should be used for filteringfilterInputValues
- the filter values- Returns:
- url as string
-
toString
-