Class IckleFilterAndConverter<K,V>
- java.lang.Object
-
- org.infinispan.filter.AbstractKeyValueFilterConverter<K,V,ObjectFilter.FilterResult>
-
- org.infinispan.query.dsl.embedded.impl.IckleFilterAndConverter<K,V>
-
- All Implemented Interfaces:
Function<Map.Entry<K,V>,ObjectFilter.FilterResult>
,Converter<K,V,ObjectFilter.FilterResult>
,KeyValueFilter<K,V>
,KeyValueFilterConverter<K,V,ObjectFilter.FilterResult>
public class IckleFilterAndConverter<K,V> extends AbstractKeyValueFilterConverter<K,V,ObjectFilter.FilterResult> implements Function<Map.Entry<K,V>,ObjectFilter.FilterResult>
A filter implementation that is both a KeyValueFilter and a converter. The implementation relies on the Matcher and a Ickle query string.- Since:
- 7.0
- Author:
- anistor@redhat.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IckleFilterAndConverter.FilterResultExternalizer
static class
IckleFilterAndConverter.IckleFilterAndConverterExternalizer
-
Field Summary
Fields Modifier and Type Field Description protected Class<? extends Matcher>
matcherImplClass
The implementation class of the Matcher component to lookup and use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectFilter.FilterResult
apply(Map.Entry<K,V> cacheEntry)
ObjectFilter.FilterResult
filterAndConvert(K key, V value, Metadata metadata)
Will both filter the entry and if passed subsequently convert the value to a new value.Matcher
getMatcher()
Map<String,Object>
getNamedParameters()
ObjectFilter
getObjectFilter()
String
getQueryString()
protected void
injectDependencies(ComponentRegistry componentRegistry, QueryCache queryCache)
Acquires a Matcher instance from the ComponentRegistry of the given Cache object.String
toString()
-
Methods inherited from class org.infinispan.filter.AbstractKeyValueFilterConverter
accept, convert
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.filter.KeyValueFilter
format
-
-
-
-
Method Detail
-
injectDependencies
protected void injectDependencies(ComponentRegistry componentRegistry, QueryCache queryCache)
Acquires a Matcher instance from the ComponentRegistry of the given Cache object.
-
getObjectFilter
public ObjectFilter getObjectFilter()
-
getQueryString
public String getQueryString()
-
getMatcher
public Matcher getMatcher()
-
filterAndConvert
public ObjectFilter.FilterResult filterAndConvert(K key, V value, Metadata metadata)
Description copied from interface:KeyValueFilterConverter
Will both filter the entry and if passed subsequently convert the value to a new value. A returned value of null will symbolize the value not passing the filter, so ensure your conversion will not return null if you want this entry to be returned.- Specified by:
filterAndConvert
in interfaceKeyValueFilterConverter<K,V,ObjectFilter.FilterResult>
- Parameters:
key
- The key of the entry to filtervalue
- The value of the entry to filter and then convertmetadata
- The metadata attached to the entry- Returns:
- The converted value or null if the filter didn't pass
-
apply
public ObjectFilter.FilterResult apply(Map.Entry<K,V> cacheEntry)
-
-