Class DefaultTwoWayKey2StringMapper
java.lang.Object
org.infinispan.persistence.keymappers.DefaultTwoWayKey2StringMapper
- All Implemented Interfaces:
Key2StringMapper
,TwoWayKey2StringMapper
- Direct Known Subclasses:
WrappedByteArrayOrPrimitiveMapper
Default implementation for
TwoWayKey2StringMapper
that knows how to handle all primitive
wrapper keys and Strings.- Since:
- 4.1
- Author:
- Mircea.Markus@jboss.com, Tristan Tarrant
-
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?
-
Constructor Details
-
DefaultTwoWayKey2StringMapper
public DefaultTwoWayKey2StringMapper()
-
-
Method Details
-
getStringMapping
Description copied from interface:Key2StringMapper
Must return an unique String for the supplied key.- Specified by:
getStringMapping
in interfaceKey2StringMapper
- 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
- 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
- Parameters:
keyType
- type to test- Returns:
- true if the type is supported, false otherwise.
-