T
- public class ExampleMatcher extends Object
ExampleMatcher
can be created
for a object type
. Instances of ExampleMatcher
can be either matching()
or
#typed(Class)
and settings can be tuned with...
methods in a fluent style. with...
methods
return a copy of the ExampleMatcher
instance with the specified setting. Null-handling defaults to
ExampleMatcher.NullHandler.IGNORE
and case-sensitive ExampleMatcher.StringMatcher.DEFAULT
string matching.
This class is immutable.
Modifier and Type | Class and Description |
---|---|
static class |
ExampleMatcher.GenericPropertyMatcher
A generic property matcher that specifies
string matching and case sensitivity. |
static class |
ExampleMatcher.GenericPropertyMatchers
Predefined property matchers to create a
ExampleMatcher.GenericPropertyMatcher . |
static interface |
ExampleMatcher.MatcherConfigurer<T>
Callback to configure a matcher.
|
static class |
ExampleMatcher.NoOpPropertyValueTransformer |
static class |
ExampleMatcher.NullHandler
Null handling for creating criterion out of an
Example . |
static class |
ExampleMatcher.PropertySpecifier
Define specific property handling for a Dot-Path.
|
static class |
ExampleMatcher.PropertySpecifiers
Define specific property handling for Dot-Paths.
|
static interface |
ExampleMatcher.PropertyValueTransformer
Allows to transform the property value before it is used in the query.
|
static class |
ExampleMatcher.StringMatcher
Match modes for treatment of
String values. |
Modifier and Type | Method and Description |
---|---|
ExampleMatcher.StringMatcher |
getDefaultStringMatcher()
Get defined
ExampleMatcher.StringMatcher . |
Set<String> |
getIgnoredPaths() |
ExampleMatcher.NullHandler |
getNullHandler()
Get defined null handling.
|
ExampleMatcher.PropertySpecifiers |
getPropertySpecifiers() |
boolean |
isAllMatching()
Returns whether all of the predicates of the
Example are supposed to match. |
boolean |
isAnyMatching()
Returns whether it's sufficient that any of the predicates of the
Example match. |
boolean |
isIgnoreCaseEnabled() |
boolean |
isIgnoredPath(String path) |
static ExampleMatcher |
matching()
Create a new
ExampleMatcher including all non-null properties by default exposing that all resulting
predicates are supposed to be AND-concatenated. |
static ExampleMatcher |
matchingAll()
Create a new
ExampleMatcher including all non-null properties by default matching all predicates derived
from the example. |
static ExampleMatcher |
matchingAny()
Create a new
ExampleMatcher including all non-null properties by default matching any predicate derived
from the example. |
ExampleMatcher |
withIgnoreCase()
Returns a copy of this
ExampleMatcher with ignoring case sensitivity by default. |
ExampleMatcher |
withIgnoreCase(boolean defaultIgnoreCase)
Returns a copy of this
ExampleMatcher with defaultIgnoreCase . |
ExampleMatcher |
withIgnoreCase(String... propertyPaths)
Returns a copy of this
ExampleMatcher with ignore case sensitivity for the propertyPaths . |
ExampleMatcher |
withIgnoreNullValues()
Returns a copy of this
ExampleMatcher with treatment for null values of
ExampleMatcher.NullHandler.IGNORE . |
ExampleMatcher |
withIgnorePaths(String... ignoredPaths)
Returns a copy of this
ExampleMatcher with the specified propertyPaths . |
ExampleMatcher |
withIncludeNullValues()
Returns a copy of this
ExampleMatcher with treatment for null values of
ExampleMatcher.NullHandler.INCLUDE . |
ExampleMatcher |
withMatcher(String propertyPath,
ExampleMatcher.GenericPropertyMatcher genericPropertyMatcher)
Returns a copy of this
ExampleMatcher with the specified GenericPropertyMatcher for the
propertyPath . |
ExampleMatcher |
withMatcher(String propertyPath,
ExampleMatcher.MatcherConfigurer<ExampleMatcher.GenericPropertyMatcher> matcherConfigurer)
Returns a copy of this
ExampleMatcher with the specified GenericPropertyMatcher for the
propertyPath . |
ExampleMatcher |
withNullHandler(ExampleMatcher.NullHandler nullHandler)
Returns a copy of this
ExampleMatcher with the specified nullHandler . |
ExampleMatcher |
withStringMatcher(ExampleMatcher.StringMatcher defaultStringMatcher)
Returns a copy of this
ExampleMatcher with the specified string matching of defaultStringMatcher . |
ExampleMatcher |
withTransformer(String propertyPath,
ExampleMatcher.PropertyValueTransformer propertyValueTransformer)
Returns a copy of this
ExampleMatcher with the specified PropertyValueTransformer for the
propertyPath . |
public static ExampleMatcher matching()
ExampleMatcher
including all non-null properties by default exposing that all resulting
predicates are supposed to be AND-concatenated.type
- will never be null.matchingAll()
public static ExampleMatcher matchingAny()
ExampleMatcher
including all non-null properties by default matching any predicate derived
from the example.type
- will never be null.public static ExampleMatcher matchingAll()
ExampleMatcher
including all non-null properties by default matching all predicates derived
from the example.type
- will never be null.public ExampleMatcher withIgnorePaths(String... ignoredPaths)
ExampleMatcher
with the specified propertyPaths
. This instance is immutable
and unaffected by this method call.ignoredPaths
- must not be null and not empty.public ExampleMatcher withStringMatcher(ExampleMatcher.StringMatcher defaultStringMatcher)
ExampleMatcher
with the specified string matching of defaultStringMatcher
.
This instance is immutable and unaffected by this method call.defaultStringMatcher
- must not be null.public ExampleMatcher withIgnoreCase()
ExampleMatcher
with ignoring case sensitivity by default. This instance is immutable
and unaffected by this method call.public ExampleMatcher withIgnoreCase(boolean defaultIgnoreCase)
ExampleMatcher
with defaultIgnoreCase
. This instance is immutable and
unaffected by this method call.defaultIgnoreCase
- public ExampleMatcher withMatcher(String propertyPath, ExampleMatcher.MatcherConfigurer<ExampleMatcher.GenericPropertyMatcher> matcherConfigurer)
ExampleMatcher
with the specified GenericPropertyMatcher
for the
propertyPath
. This instance is immutable and unaffected by this method call.propertyPath
- must not be null.matcherConfigurer
- callback to configure a ExampleMatcher.GenericPropertyMatcher
, must not be null.public ExampleMatcher withMatcher(String propertyPath, ExampleMatcher.GenericPropertyMatcher genericPropertyMatcher)
ExampleMatcher
with the specified GenericPropertyMatcher
for the
propertyPath
. This instance is immutable and unaffected by this method call.propertyPath
- must not be null.genericPropertyMatcher
- callback to configure a ExampleMatcher.GenericPropertyMatcher
, must not be null.public ExampleMatcher withTransformer(String propertyPath, ExampleMatcher.PropertyValueTransformer propertyValueTransformer)
ExampleMatcher
with the specified PropertyValueTransformer
for the
propertyPath
.propertyPath
- must not be null.propertyValueTransformer
- must not be null.public ExampleMatcher withIgnoreCase(String... propertyPaths)
ExampleMatcher
with ignore case sensitivity for the propertyPaths
. This
instance is immutable and unaffected by this method call.propertyPaths
- must not be null and not empty.public ExampleMatcher withIncludeNullValues()
ExampleMatcher
with treatment for null values of
ExampleMatcher.NullHandler.INCLUDE
. This instance is immutable and unaffected by this method call.public ExampleMatcher withIgnoreNullValues()
ExampleMatcher
with treatment for null values of
ExampleMatcher.NullHandler.IGNORE
. This instance is immutable and unaffected by this method call.public ExampleMatcher withNullHandler(ExampleMatcher.NullHandler nullHandler)
ExampleMatcher
with the specified nullHandler
. This instance is immutable
and unaffected by this method call.nullHandler
- must not be null.public ExampleMatcher.NullHandler getNullHandler()
public ExampleMatcher.StringMatcher getDefaultStringMatcher()
ExampleMatcher.StringMatcher
.public boolean isIgnoreCaseEnabled()
String
should be matched with ignore case option.public boolean isIgnoredPath(String path)
path
- public ExampleMatcher.PropertySpecifiers getPropertySpecifiers()
ExampleMatcher.PropertySpecifiers
within the ExampleMatcher
.public boolean isAllMatching()
Example
are supposed to match. If false is
returned, it's sufficient if any of the predicates derived from the Example
match.Example
are supposed to match or any of them is sufficient.public boolean isAnyMatching()
Example
match. If false is
returned, all predicates derived from the example need to match to produce results.Example
match or all need to match.Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.