Package com.tangosol.util
Class InvocableMapHelper.RoutingMapTriggerEntry
java.lang.Object
com.tangosol.util.InvocableMapHelper.RoutingMapTriggerEntry
- All Implemented Interfaces:
InvocableMap.Entry,MapTrigger.Entry,QueryMap.Entry,Map.Entry
- Direct Known Subclasses:
InvocableMapHelper.RoutingBinaryEntry
- Enclosing class:
InvocableMapHelper
protected static class InvocableMapHelper.RoutingMapTriggerEntry
extends Object
implements MapTrigger.Entry
MapTrigger.Entry wrapper that routes the getValue() call onto
getOriginalValue().
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a routing entry.protectedConstruct a routing entry. -
Method Summary
Modifier and TypeMethodDescriptionextract(ValueExtractor extractor) Extract a value out of the Entry's key or value.getKey()Return the key corresponding to this entry.Determine the value that existed before the start of the mutating operation that is being evaluated by the trigger.getValue()Return an OriginalValue from the underlying entry.booleanDetermine whether or not the Entry existed before the start of the mutating operation that is being evaluated by the trigger.booleanDetermine if this Entry exists in the Map.booleanDetermine if this Entry has been synthetically mutated.voidremove(boolean fSynthetic) Remove this Entry from the Map if it is present in the Map.Store the value corresponding to this entry.voidStore the value corresponding to this entry.voidupdate(ValueUpdater updater, Object oValue) Update the Entry's value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tangosol.util.InvocableMap.Entry
asBinaryEntry, getValue, getValueMethods inherited from interface com.tangosol.util.QueryMap.Entry
extractFromKey, extractFromValue
-
Field Details
-
m_entry
The underlying entry. We artificially widen the type to be able to extend this class.
-
-
Constructor Details
-
RoutingMapTriggerEntry
Construct a routing entry.- Parameters:
entry- the underlying MapTrigger.Entry
-
RoutingMapTriggerEntry
Construct a routing entry.- Parameters:
entry- the underlying BinaryEntry
-
-
Method Details
-
getKey
Return the key corresponding to this entry. The resultant key does not necessarily exist within the containing Map, which is to say that InvocableMap.this.containsKey(getKey()) could return false. To test for the presence of this key within the Map, useInvocableMap.Entry.isPresent(), and to create the entry for the key, useInvocableMap.Entry.setValue(V).- Specified by:
getKeyin interfaceInvocableMap.Entry- Specified by:
getKeyin interfaceMap.Entry- Returns:
- the key corresponding to this entry; may be null if the underlying Map supports null keys
-
getValue
Return an OriginalValue from the underlying entry.- Specified by:
getValuein interfaceInvocableMap.Entry- Specified by:
getValuein interfaceMap.Entry- Returns:
- the value corresponding to this entry; may be null if the value is null or if the Entry does not exist in the Map
-
extract
Extract a value out of the Entry's key or value. Calling this method is semantically equivalent to extractor.extract(entry.getValue()), but this method may be significantly less expensive. For example, the resultant value may be obtained from a forward index, avoiding a potential object de-serialization.- Specified by:
extractin interfaceQueryMap.Entry- Parameters:
extractor- a ValueExtractor to apply to the Entry's key or value- Returns:
- the extracted value
-
getOriginalValue
Description copied from interface:MapTrigger.EntryDetermine the value that existed before the start of the mutating operation that is being evaluated by the trigger.- Specified by:
getOriginalValuein interfaceMapTrigger.Entry- Returns:
- the original value corresponding to this Entry; may be null if the value is null or if the Entry did not exist in the Map
- Throws:
UnsupportedOperationException
-
setValue
Description copied from interface:InvocableMap.EntryStore the value corresponding to this entry. If the entry does not exist, then the entry will be created by invoking this method, even with a null value (assuming the Map supports null values).- Specified by:
setValuein interfaceInvocableMap.Entry- Specified by:
setValuein interfaceMap.Entry- Parameters:
oValue- the new value for this Entry- Returns:
- the previous value of this Entry, or null if the Entry did not exist
- Throws:
UnsupportedOperationException
-
setValue
Description copied from interface:InvocableMap.EntryStore the value corresponding to this entry. If the entry does not exist, then the entry will be created by invoking this method, even with a null value (assuming the Map supports null values).Unlike the other form of
setValue, this form does not return the previous value, and as a result may be significantly less expensive (in terms of cost of execution) for certain Map implementations.- Specified by:
setValuein interfaceInvocableMap.Entry- Parameters:
oValue- the new value for this EntryfSynthetic- pass true only if the insertion into or modification of the Map should be treated as a synthetic event- Throws:
UnsupportedOperationException
-
update
Description copied from interface:InvocableMap.EntryUpdate the Entry's value. Calling this method is semantically equivalent to:V target = entry.getValue(); updater.update(target, value); entry.setValue(target, false);
The benefit of using this method is that it may allow the Entry implementation to significantly optimize the operation, such as for purposes of delta updates and backup maintenance.- Specified by:
updatein interfaceInvocableMap.Entry- Parameters:
updater- a ValueUpdater used to modify the Entry's valueoValue- the new value for this Entry- Throws:
UnsupportedOperationException
-
remove
public void remove(boolean fSynthetic) Description copied from interface:InvocableMap.EntryRemove this Entry from the Map if it is present in the Map.This method supports both the operation corresponding to
Map.remove(java.lang.Object)as well as synthetic operations such as eviction. If the containing Map does not differentiate between the two, then this method will always be identical to InvocableMap.this.remove(getKey()).- Specified by:
removein interfaceInvocableMap.Entry- Parameters:
fSynthetic- pass true only if the removal from the Map should be treated as a synthetic event- Throws:
UnsupportedOperationException
-
isPresent
public boolean isPresent()Description copied from interface:InvocableMap.EntryDetermine if this Entry exists in the Map. If the Entry is not present, it can be created by callingInvocableMap.Entry.setValue(Object)orInvocableMap.Entry.setValue(Object, boolean). If the Entry is present, it can be destroyed by callingInvocableMap.Entry.remove(boolean).- Specified by:
isPresentin interfaceInvocableMap.Entry- Returns:
- true iff this Entry is existent in the containing Map
- Throws:
UnsupportedOperationException
-
isSynthetic
public boolean isSynthetic()Description copied from interface:InvocableMap.EntryDetermine if this Entry has been synthetically mutated. This method returnsfalseif either a non-synthetic update was made or the entry has not been modified.- Specified by:
isSyntheticin interfaceInvocableMap.Entry- Returns:
- true if the Entry has been synthetically mutated
- Throws:
UnsupportedOperationException
-
isOriginalPresent
public boolean isOriginalPresent()Description copied from interface:MapTrigger.EntryDetermine whether or not the Entry existed before the start of the mutating operation that is being evaluated by the trigger.- Specified by:
isOriginalPresentin interfaceMapTrigger.Entry- Returns:
- true iff this Entry was existent in the containing Map
- Throws:
UnsupportedOperationException
-