com.hazelcast.map.merge
Class PutIfAbsentMapMergePolicy

java.lang.Object
  extended by com.hazelcast.map.merge.PutIfAbsentMapMergePolicy
All Implemented Interfaces:
MapMergePolicy, DataSerializable

public class PutIfAbsentMapMergePolicy
extends Object
implements MapMergePolicy, DataSerializable

PutIfAbsentMapMergePolicy causes the merging entry to be merged from source to destination map if it does not exist in the destination map.


Constructor Summary
PutIfAbsentMapMergePolicy()
           
 
Method Summary
 Object merge(String mapName, EntryView mergingEntry, EntryView existingEntry)
          Returns the value of the entry after the merge of entries with the same key.
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PutIfAbsentMapMergePolicy

public PutIfAbsentMapMergePolicy()
Method Detail

merge

public Object merge(String mapName,
                    EntryView mergingEntry,
                    EntryView existingEntry)
Description copied from interface: MapMergePolicy
Returns the value of the entry after the merge of entries with the same key. You should consider the case where existingEntry's value is null.

Specified by:
merge in interface MapMergePolicy
Parameters:
mapName - name of the map
mergingEntry - entry merging into the destination cluster
existingEntry - existing entry in the destination cluster
Returns:
final value of the entry. If returns null then entry will be removed.

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.