Package org.infinispan.marshall.core
Class MarshalledEntryImpl<K,V>
- java.lang.Object
-
- org.infinispan.marshall.core.MarshalledEntryImpl<K,V>
-
- All Implemented Interfaces:
MarshalledEntry<K,V>
public class MarshalledEntryImpl<K,V> extends java.lang.Object implements MarshalledEntry<K,V>
- Since:
- 6.0
- Author:
- Mircea Markus
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MarshalledEntryImpl.Externalizer
-
Constructor Summary
Constructors Constructor Description MarshalledEntryImpl(K key, ByteBuffer valueBytes, ByteBuffer metadataBytes, StreamingMarshaller marshaller)
MarshalledEntryImpl(K key, V value, InternalMetadata im, StreamingMarshaller sm)
MarshalledEntryImpl(ByteBuffer key, ByteBuffer valueBytes, ByteBuffer metadataBytes, StreamingMarshaller marshaller)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V>
MarshalledEntry<K,V>empty()
Returns the value that should be used as an empty MarshalledEntry.boolean
equals(java.lang.Object o)
K
getKey()
Returns the same key asMarshalledEntry.getKeyBytes()
, but unmarshalled.ByteBuffer
getKeyBytes()
Returns the key in serialized format.InternalMetadata
getMetadata()
ByteBuffer
getMetadataBytes()
V
getValue()
Returns the same value asMarshalledEntry.getKeyBytes()
, but unmarshalled.ByteBuffer
getValueBytes()
Returns the value in serialize format.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
MarshalledEntryImpl
public MarshalledEntryImpl(ByteBuffer key, ByteBuffer valueBytes, ByteBuffer metadataBytes, StreamingMarshaller marshaller)
-
MarshalledEntryImpl
public MarshalledEntryImpl(K key, ByteBuffer valueBytes, ByteBuffer metadataBytes, StreamingMarshaller marshaller)
-
MarshalledEntryImpl
public MarshalledEntryImpl(K key, V value, InternalMetadata im, StreamingMarshaller sm)
-
-
Method Detail
-
empty
public static <K,V> MarshalledEntry<K,V> empty()
Returns the value that should be used as an empty MarshalledEntry. This can be useful when a non null value is required.- Type Parameters:
K
- key typeV
- value type- Returns:
- cached empty marshalled entry
-
getKey
public K getKey()
Description copied from interface:MarshalledEntry
Returns the same key asMarshalledEntry.getKeyBytes()
, but unmarshalled.- Specified by:
getKey
in interfaceMarshalledEntry<K,V>
-
getValue
public V getValue()
Description copied from interface:MarshalledEntry
Returns the same value asMarshalledEntry.getKeyBytes()
, but unmarshalled.- Specified by:
getValue
in interfaceMarshalledEntry<K,V>
-
getMetadata
public InternalMetadata getMetadata()
- Specified by:
getMetadata
in interfaceMarshalledEntry<K,V>
- Returns:
- might be null if there's no metadata associated with the object (e.g. expiry info, version..).
-
getKeyBytes
public ByteBuffer getKeyBytes()
Description copied from interface:MarshalledEntry
Returns the key in serialized format.- Specified by:
getKeyBytes
in interfaceMarshalledEntry<K,V>
-
getValueBytes
public ByteBuffer getValueBytes()
Description copied from interface:MarshalledEntry
Returns the value in serialize format.- Specified by:
getValueBytes
in interfaceMarshalledEntry<K,V>
-
getMetadataBytes
public ByteBuffer getMetadataBytes()
- Specified by:
getMetadataBytes
in interfaceMarshalledEntry<K,V>
- Returns:
- null if there's no metadata associated with the object (e.g. expiry info, version..)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-