Class QueryParamBuilder

java.lang.Object
io.rocketbase.commons.util.QueryParamBuilder

public final class QueryParamBuilder extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.springframework.web.util.UriComponentsBuilder
    appendParamEnums(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Collection<? extends Enum> values)
     
    static org.springframework.web.util.UriComponentsBuilder
    appendParamNumbers(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Collection<? extends Number> values)
     
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Boolean value)
    add Boolean value to query
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Enum value)
     
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Number value)
    add number value to query
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, String value)
    add string value to query if not null value
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String pageSizeKey, String pageKey, String sortKey, org.springframework.data.domain.Pageable value)
    custom queryKeys for pageable query
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Instant value)
    add Instant value to query
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, LocalDate value)
    add LocalDate value to query
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, LocalDateTime value)
    add LocalDateTime value to query
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, LocalTime value)
    add LocalTime value to query
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Map<String,String> keyValues)
     
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, org.springframework.data.domain.Sort value)
    in case you just want to add sort
    static org.springframework.web.util.UriComponentsBuilder
    appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, org.springframework.data.domain.Pageable pageable)
    use default keys ("pageSize", "page", "sort") for pageable query
    static org.springframework.web.util.UriComponentsBuilder
    appendParamStrings(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Collection<? extends String> values)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • QueryParamBuilder

      public QueryParamBuilder()
  • Method Details

    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, String value)
      add string value to query if not null value
      Parameters:
      uriBuilder - instance that will get added queryParams
      key - key of the given value
      value - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, org.springframework.data.domain.Pageable pageable)
      use default keys ("pageSize", "page", "sort") for pageable query
      Parameters:
      uriBuilder - instance that will get added queryParams
      pageable - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String pageSizeKey, String pageKey, String sortKey, org.springframework.data.domain.Pageable value)
      custom queryKeys for pageable query
      Parameters:
      uriBuilder - instance that will get added queryParams
      pageSizeKey - queryParam for getPageSize
      pageKey - queryParam for getPageNumber
      sortKey - queryParam for sort
      value - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, org.springframework.data.domain.Sort value)
      in case you just want to add sort
      Parameters:
      uriBuilder - instance that will get added queryParams
      key - key of sort parameter
      value - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Number value)
      add number value to query
      Parameters:
      uriBuilder - instance that will get added queryParams
      key - key of the given value
      value - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Boolean value)
      add Boolean value to query
      Parameters:
      uriBuilder - instance that will get added queryParams
      key - key of the given value
      value - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, LocalDate value)
      add LocalDate value to query
      Parameters:
      uriBuilder - instance that will get added queryParams
      key - key of the given value
      value - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, LocalTime value)
      add LocalTime value to query
      Parameters:
      uriBuilder - instance that will get added queryParams
      key - key of the given value
      value - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, LocalDateTime value)
      add LocalDateTime value to query
      Parameters:
      uriBuilder - instance that will get added queryParams
      key - key of the given value
      value - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Instant value)
      add Instant value to query
      Parameters:
      uriBuilder - instance that will get added queryParams
      key - key of the given value
      value - value to add to query
      Returns:
      uriBuilder itself for fluent api
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Enum value)
    • appendParamEnums

      public static org.springframework.web.util.UriComponentsBuilder appendParamEnums(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Collection<? extends Enum> values)
    • appendParamNumbers

      public static org.springframework.web.util.UriComponentsBuilder appendParamNumbers(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Collection<? extends Number> values)
    • appendParamStrings

      public static org.springframework.web.util.UriComponentsBuilder appendParamStrings(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Collection<? extends String> values)
    • appendParams

      public static org.springframework.web.util.UriComponentsBuilder appendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Map<String,String> keyValues)