Class SpecificationBuilder<T extends org.springframework.data.jpa.domain.Specification>
java.lang.Object
net.kaczmarzyk.spring.data.jpa.utils.SpecificationBuilder<T>
public final class SpecificationBuilder<T extends org.springframework.data.jpa.domain.Specification>
extends Object
SpecificationBuilder allows creating specification apart from web layer.
It is recommended to use builder methods that corresponding to the type of argument passed to specification.
-
params = <args> => withParam(<argName>, <values...>), single param argument can provide multiple values -
pathVars = <args> => withPathVar(<argName>, <value>), single pathVar argument can provide single value -
headers = <args> => withHeader(<argName>, <value>), single header argument can provide single value
- Author:
- Jakub Radlica, Kacper Leśniak (Tratif sp. z o.o.)
-
Method Summary
Modifier and TypeMethodDescriptionbuild()static <T extends org.springframework.data.jpa.domain.Specification<?>>
SpecificationBuilder<T>specification(Class<T> specInterface) The direct methods for params/headers/pathVars should be used in most common scenarios in order to avoid hard-to-debug errors.withHeader(String header, String value) withJsonBodyParam(String jsonPath, String... values) withPathVar(String pathVar, String value) withSpecificationFactory(SpecificationFactory specificationFactory)
-
Method Details
-
specification
public static <T extends org.springframework.data.jpa.domain.Specification<?>> SpecificationBuilder<T> specification(Class<T> specInterface) -
withSpecificationFactory
-
withArg
The direct methods for params/headers/pathVars should be used in most common scenarios in order to avoid hard-to-debug errors. Use this method only if you really understand how it works. -
withParam
-
withPathVar
-
withHeader
-
withJsonBodyParam
-
build
-