Class DefaultLinkBuilder

java.lang.Object
de.cxp.ocs.util.DefaultLinkBuilder
All Implemented Interfaces:
LinkBuilder

public final class DefaultLinkBuilder extends Object implements LinkBuilder
  • Field Details

    • VALUE_DELIMITER

      public static String VALUE_DELIMITER
    • VALUE_DELIMITER_ENCODED

      public static String VALUE_DELIMITER_ENCODED
    • SORT_DESC_PREFIX

      public static String SORT_DESC_PREFIX
  • Constructor Details

  • Method Details

    • toLink

      public static URI toLink(InternalSearchParams params)
    • withSortingLink

      public String withSortingLink(Field sortField, SortOrder sortOrder)
    • isSortingActive

      public boolean isSortingActive(Field sortField, SortOrder order)
    • sortStringRepresentation

      public static String sortStringRepresentation(String fieldName, SortOrder order)
    • getSortingsString

      public static String getSortingsString(List<SortInstruction> sortings)
    • joinParameterValues

      public static String joinParameterValues(String... values)
    • withoutFilterAsLink

      public String withoutFilterAsLink(FacetConfiguration.FacetConfig facetConfig, String... filterValues)
    • withoutFilterAsLink

      public String withoutFilterAsLink(FacetConfiguration.FacetConfig facetConfig)
      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

      public String withoutFilterAsLink(String filterName)
      Removes the complete filter parameter and returns the link.
      Specified by:
      withoutFilterAsLink in interface LinkBuilder
      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

      public String withFilterAsLink(String filterName, boolean mergeValues, String... filterInputValues)
      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 interface LinkBuilder
      Parameters:
      filterName - name of the filter to add
      mergeValues - set true to merge values in case of existing filter, to replace existing values set to false
      filterInputValues - 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 filtering
      filterInputValues - the filter values
      Returns:
      url as string
    • toString

      public String toString()
      Overrides:
      toString in class Object