Class WrappedByteArrayOrPrimitiveMapper
java.lang.Object
org.infinispan.persistence.keymappers.DefaultTwoWayKey2StringMapper
org.infinispan.persistence.keymappers.WrappedByteArrayOrPrimitiveMapper
- All Implemented Interfaces:
Key2StringMapper
,MarshallingTwoWayKey2StringMapper
,TwoWayKey2StringMapper
public class WrappedByteArrayOrPrimitiveMapper
extends DefaultTwoWayKey2StringMapper
implements MarshallingTwoWayKey2StringMapper
This class is an implementation for
TwoWayKey2StringMapper
that supports both primitives
and WrappedByteArray
s. It extends DefaultTwoWayKey2StringMapper
to achieve this.- Since:
- 5.2
- Author:
- Justin Hayes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetKeyMapping
(String key) Maps a String back to its original keygetStringMapping
(Object key) Must return an unique String for the supplied key.boolean
isSupportedType
(Class<?> keyType) Do we support this key type?void
setMarshaller
(StreamingMarshaller marshaller) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.infinispan.persistence.keymappers.MarshallingTwoWayKey2StringMapper
setMarshaller
-
Constructor Details
-
WrappedByteArrayOrPrimitiveMapper
public WrappedByteArrayOrPrimitiveMapper()
-
-
Method Details
-
setMarshaller
- Specified by:
setMarshaller
in interfaceMarshallingTwoWayKey2StringMapper
-
getStringMapping
Description copied from interface:Key2StringMapper
Must return an unique String for the supplied key.- Specified by:
getStringMapping
in interfaceKey2StringMapper
- Overrides:
getStringMapping
in classDefaultTwoWayKey2StringMapper
- Parameters:
key
- key to map to a String- Returns:
- String representation of the key
-
getKeyMapping
Description copied from interface:TwoWayKey2StringMapper
Maps a String back to its original key- Specified by:
getKeyMapping
in interfaceTwoWayKey2StringMapper
- Overrides:
getKeyMapping
in classDefaultTwoWayKey2StringMapper
- Parameters:
key
- string representation of a key- Returns:
- an object instance that is equal to the original object used to create the key mapping.
-
isSupportedType
Description copied from interface:Key2StringMapper
Do we support this key type?- Specified by:
isSupportedType
in interfaceKey2StringMapper
- Overrides:
isSupportedType
in classDefaultTwoWayKey2StringMapper
- Parameters:
keyType
- type to test- Returns:
- true if the type is supported, false otherwise.
-