Package org.springframework.data.domain
Interface Example<T>
- Type Parameters:
T
- the type of the probe.
public interface Example<T>
Support for query by example (QBE). An
Example
takes a probe
to define the example. Matching options
and type safety can be tuned using ExampleMatcher
.- Since:
- 1.12
- Author:
- Christoph Strobl, Mark Paluch, Oliver Gierke
-
Method Summary
Modifier and TypeMethodDescriptionGet theExampleMatcher
used.getProbe()
Get the example used.Get the actual type for the probe used.static <T> Example<T>
of
(T probe) Create a newExample
including all non-null properties by default.static <T> Example<T>
of
(T probe, ExampleMatcher matcher) Create a newExample
using the givenExampleMatcher
.
-
Method Details
-
of
Create a newExample
including all non-null properties by default.- Parameters:
probe
- must not be null.- Returns:
-
of
Create a newExample
using the givenExampleMatcher
.- Parameters:
probe
- must not be null.matcher
- must not be null.- Returns:
-
getProbe
T getProbe()Get the example used.- Returns:
- never null.
-
getMatcher
ExampleMatcher getMatcher()Get theExampleMatcher
used.- Returns:
- never null.
-
getProbeType
Get the actual type for the probe used. This is usually the given class, but the original class in case of a CGLIB-generated subclass.- Returns:
- See Also:
-