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 Details

    • of

      static <T> Example<T> of(T probe)
      Create a new Example including all non-null properties by default.
      Parameters:
      probe - must not be null.
      Returns:
    • of

      static <T> Example<T> of(T probe, ExampleMatcher matcher)
      Create a new Example using the given ExampleMatcher.
      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 the ExampleMatcher used.
      Returns:
      never null.
    • getProbeType

      default Class<T> 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: