public class LazyMapEntry extends CachedQueryEntry implements Serializable, IdentifiedDataSerializable
Map.Entry
implementation which serializes/de-serializes key and value objects on demand.
It is beneficial when you need to prevent unneeded serialization/de-serialization
when creating a Map.Entry
. Mainly targeted to supply a lazy entry to
EntryProcessor.process(Map.Entry)
and
EntryBackupProcessor.processBackup(Map.Entry)
} methods.
Note that this implementation is not synchronized and is not thread-safe.
LazyMapEntry itself is serializable as long as the object representations of both key and value are serializable.
After serialization objects are resolved using injected SerializationService. De-serialized LazyMapEntry
does contain object representation only Data representations and SerializationService is set to null. In other
words: It's as usable just as a regular Map.Entry.keyData, keyObject, valueData, valueObject
extractors, serializationService
Constructor and Description |
---|
LazyMapEntry() |
LazyMapEntry(Data key,
Object value,
InternalSerializationService serializationService) |
LazyMapEntry(Data key,
Object value,
InternalSerializationService serializationService,
Extractors extractors) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getFactoryId()
Returns DataSerializableFactory factory id for this class.
|
int |
getId()
Returns type identifier for this class.
|
int |
hashCode() |
boolean |
isModified() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
remove()
Similar to calling
setValue(java.lang.Object) with null but doesn't return old-value hence no extra deserialization. |
Object |
setValue(Object value) |
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
getKey, getKeyData, getTargetObject, getValue, getValueData, init
getAttributeType, getAttributeValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
comparingByKey, comparingByKey, comparingByValue, comparingByValue
public LazyMapEntry()
public LazyMapEntry(Data key, Object value, InternalSerializationService serializationService)
public LazyMapEntry(Data key, Object value, InternalSerializationService serializationService, Extractors extractors)
public Object setValue(Object value)
setValue
in interface Map.Entry
setValue
in class CachedQueryEntry
public void remove()
setValue(java.lang.Object)
with null but doesn't return old-value hence no extra deserialization.public boolean isModified()
public boolean equals(Object o)
equals
in interface Map.Entry
equals
in class CachedQueryEntry
public int hashCode()
hashCode
in interface Map.Entry
hashCode
in class CachedQueryEntry
public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.