public class KeyValueFilterConverterAsCacheEventFilterConverter<K,V,C> extends java.lang.Object implements CacheEventFilterConverter<K,V,C>
CacheEventFilterConverter that uses an underlying KeyValueFilterConverter to do the conversion and
filtering. The new value and metadata are used as arguments to the underlying filter converter as it doesn't take
both new and old.| Modifier and Type | Class and Description |
|---|---|
static class |
KeyValueFilterConverterAsCacheEventFilterConverter.Externalizer |
| Constructor and Description |
|---|
KeyValueFilterConverterAsCacheEventFilterConverter(KeyValueFilterConverter<K,V,C> keyValueFilterConverter) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(K key,
V oldValue,
Metadata oldMetadata,
V newValue,
Metadata newMetadata,
EventType eventType)
Whether or not this event should be raised to the listener it is attached to.
|
C |
convert(K key,
V oldValue,
Metadata oldMetadata,
V newValue,
Metadata newMetadata,
EventType eventType)
Converts the given newValue into something different possibly.
|
C |
filterAndConvert(K key,
V oldValue,
Metadata oldMetadata,
V newValue,
Metadata newMetadata,
EventType eventType)
Will both filter the entry and if passed subsequently convert the value to a new value.
|
protected void |
injectDependencies(ComponentRegistry cr) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitformatuseRequestFormatpublic KeyValueFilterConverterAsCacheEventFilterConverter(KeyValueFilterConverter<K,V,C> keyValueFilterConverter)
public C filterAndConvert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)
CacheEventFilterConverternull will symbolize the value not passing the filter, so ensure your conversion will not return null if
you want this entry to be returned.filterAndConvert in interface CacheEventFilterConverter<K,V,C>key - The key for the entry that was changed for the eventoldValue - The previous value before the event takes placeoldMetadata - The old value before the event takes placenewValue - The new value for the entry after the event takes placenewMetadata - The new metadata for the entry after the event takes placeeventType - The type of event that is being raisednull value converted value when it also passes the filter or null for when it
doesn't pass the filterpublic C convert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)
CacheEventConverterconvert in interface CacheEventConverter<K,V,C>key - The key for the entry that was changed for the eventoldValue - The previous value before the event takes placeoldMetadata - The old value before the event takes placenewValue - The new value for the entry after the event takes placenewMetadata - The new metadata for the entry after the event takes placeeventType - The type of event that is being raisedpublic boolean accept(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)
CacheEventFilteraccept in interface CacheEventFilter<K,V>key - The key for the entry that was changed for the eventoldValue - The previous value before the event takes placeoldMetadata - The old value before the event takes placenewValue - The new value for the entry after the event takes placenewMetadata - The new metadata for the entry after the event takes placeeventType - The type of event that is being raisedprotected void injectDependencies(ComponentRegistry cr)