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 forTwoWayKey2StringMapper
that supports both primitives andWrappedByteArray
s. It extendsDefaultTwoWayKey2StringMapper
to achieve this.- Since:
- 5.2
- Author:
- Justin Hayes
-
-
Constructor Summary
Constructors Constructor Description WrappedByteArrayOrPrimitiveMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getKeyMapping(java.lang.String key)
Maps a String back to its original keyjava.lang.String
getStringMapping(java.lang.Object key)
Must return an unique String for the supplied key.boolean
isSupportedType(java.lang.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
-
-
-
-
Method Detail
-
setMarshaller
public void setMarshaller(StreamingMarshaller marshaller)
- Specified by:
setMarshaller
in interfaceMarshallingTwoWayKey2StringMapper
-
getStringMapping
public java.lang.String getStringMapping(java.lang.Object key)
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
public java.lang.Object getKeyMapping(java.lang.String key)
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
public boolean isSupportedType(java.lang.Class<?> keyType)
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.
-
-