Interface SortMapper

All Known Implementing Classes:
SortMapper.DefaultSortMapper

public interface SortMapper
This mapper provides methods to transform a SortOrderItem into a Sort object from the Spring framework (spring-data-common) and vice versa.
Author:
Christian Bremer
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    The default sort mapper.
  • Method Summary

    Modifier and Type
    Method
    Description
    default org.springframework.data.domain.Pageable
    applyDefaults(org.springframework.data.domain.Pageable source, org.springframework.data.domain.Sort.Direction direction, Boolean ignoreCase, org.springframework.data.domain.Sort.NullHandling nullHandling, String... properties)
    Apply defaults to page request.
    default org.springframework.data.domain.Sort
    applyDefaults(org.springframework.data.domain.Sort source, org.springframework.data.domain.Sort.Direction direction, Boolean ignoreCase, org.springframework.data.domain.Sort.NullHandling nullHandling, String... properties)
    Apply defaults to sort.
    static SortMapper
    Returns default sort mapper.
    static SortMapper
    defaultSortMapper(SortOrderTextSeparators sortOrderTextSeparators)
    Returns default sort mapper.
    static SortMapper
    Returns default sort mapper.
    default SortOrder
    fromSort(org.springframework.data.domain.Sort sort)
    Transforms a Sort object into a sort order.
    fromSortOrder(org.springframework.data.domain.Sort.Order sortOrder)
    Transforms a Sort.Order object into a sort order.
    getSortOrder(String sortOrderText)
    Gets sort order from text.
    Gets sort order text of items.
    Gets sort order text.
    default org.springframework.data.domain.Sort
    toSort(SortOrder sortOrder)
    Transforms sort order into a Sort object.
    default org.springframework.data.domain.Sort.Order
    toSortOrder(SortOrderItem sortOrderItem)
    Transforms the sort order into a Sort.Order object.
  • Method Details

    • defaultSortMapper

      static SortMapper defaultSortMapper()
      Returns default sort mapper.
      Returns:
      the sort mapper
    • defaultSortMapper

      static SortMapper defaultSortMapper(SortOrderTextSeparators sortOrderTextSeparators)
      Returns default sort mapper.
      Parameters:
      sortOrderTextSeparators - the sort order text separators
      Returns:
      the sort mapper
    • defaultSortMapper

      static SortMapper defaultSortMapper(SortOrderConverter sortOrderConverter)
      Returns default sort mapper.
      Parameters:
      sortOrderConverter - the sort order converter
      Returns:
      the sort mapper
    • getSortOrder

      SortOrder getSortOrder(@Nullable String sortOrderText)
      Gets sort order from text.
      Parameters:
      sortOrderText - the sort order text
      Returns:
      the sort order
    • getSortOrderText

      String getSortOrderText(@Nullable SortOrder sortOrder)
      Gets sort order text.
      Parameters:
      sortOrder - the sort order
      Returns:
      the sort order text
    • getSortOrderItemText

      List<String> getSortOrderItemText(@Nullable SortOrder sortOrder)
      Gets sort order text of items.
      Parameters:
      sortOrder - the sort order
      Returns:
      the sort order item text
    • toSort

      @NonNull default org.springframework.data.domain.Sort toSort(@Nullable SortOrder sortOrder)
      Transforms sort order into a Sort object.
      Parameters:
      sortOrder - the sort order
      Returns:
      the sort
    • toSortOrder

      @Nullable default org.springframework.data.domain.Sort.Order toSortOrder(@Nullable SortOrderItem sortOrderItem)
      Transforms the sort order into a Sort.Order object.
      Parameters:
      sortOrderItem - the sort order
      Returns:
      the sort object
    • fromSort

      @NonNull default SortOrder fromSort(@Nullable org.springframework.data.domain.Sort sort)
      Transforms a Sort object into a sort order.
      Parameters:
      sort - the Sort object
      Returns:
      the sort order
    • fromSortOrder

      @Nullable default SortOrderItem fromSortOrder(@Nullable org.springframework.data.domain.Sort.Order sortOrder)
      Transforms a Sort.Order object into a sort order.
      Parameters:
      sortOrder - the Sort.Order object
      Returns:
      the sort order
    • applyDefaults

      @Nullable default org.springframework.data.domain.Pageable applyDefaults(@Nullable org.springframework.data.domain.Pageable source, @Nullable org.springframework.data.domain.Sort.Direction direction, @Nullable Boolean ignoreCase, @Nullable org.springframework.data.domain.Sort.NullHandling nullHandling, @Nullable String... properties)
      Apply defaults to page request.
      Parameters:
      source - the source
      direction - the direction
      ignoreCase - the ignore case
      nullHandling - the null handling
      properties - the properties
      Returns:
      the pageable
    • applyDefaults

      @NonNull default org.springframework.data.domain.Sort applyDefaults(@Nullable org.springframework.data.domain.Sort source, @Nullable org.springframework.data.domain.Sort.Direction direction, @Nullable Boolean ignoreCase, @Nullable org.springframework.data.domain.Sort.NullHandling nullHandling, @Nullable String... properties)
      Apply defaults to sort.
      Parameters:
      source - the source
      direction - the direction
      ignoreCase - the ignore case
      nullHandling - the null handling
      properties - the properties
      Returns:
      the sort