Package io.rocketbase.commons.util
Class QueryParamBuilder
java.lang.Object
io.rocketbase.commons.util.QueryParamBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.web.util.UriComponentsBuilderappendParamEnums(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Collection<? extends Enum> values) static org.springframework.web.util.UriComponentsBuilderappendParamNumbers(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Collection<? extends Number> values) static org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Boolean value) add Boolean value to querystatic org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Enum value) static org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Number value) add number value to querystatic org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, String value) add string value to query if not null valuestatic org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String pageSizeKey, String pageKey, String sortKey, org.springframework.data.domain.Pageable value) custom queryKeys for pageable querystatic org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Instant value) add Instant value to querystatic org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, LocalDate value) add LocalDate value to querystatic org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, LocalDateTime value) add LocalDateTime value to querystatic org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, LocalTime value) add LocalTime value to querystatic org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Map<String, String> keyValues) static org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, org.springframework.data.domain.Sort value) in case you just want to add sortstatic org.springframework.web.util.UriComponentsBuilderappendParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, org.springframework.data.domain.Pageable pageable) use default keys ("pageSize", "page", "sort") for pageable querystatic org.springframework.web.util.UriComponentsBuilderappendParamStrings(org.springframework.web.util.UriComponentsBuilder uriBuilder, String key, Collection<? extends String> values)
-
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 queryParamskey- key of the given valuevalue- 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 queryParamspageable- 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 queryParamspageSizeKey- queryParam for getPageSizepageKey- queryParam for getPageNumbersortKey- queryParam for sortvalue- 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 queryParamskey- key of sort parametervalue- 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 queryParamskey- key of the given valuevalue- 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 queryParamskey- key of the given valuevalue- 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 queryParamskey- key of the given valuevalue- 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 queryParamskey- key of the given valuevalue- 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 queryParamskey- key of the given valuevalue- 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 queryParamskey- key of the given valuevalue- value to add to query- Returns:
- uriBuilder itself for fluent api
-
appendParams
-
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
-