Class DefaultTwoWayKey2StringMapper
- java.lang.Object
-
- org.infinispan.persistence.keymappers.DefaultTwoWayKey2StringMapper
-
- All Implemented Interfaces:
Key2StringMapper,TwoWayKey2StringMapper
- Direct Known Subclasses:
WrappedByteArrayOrPrimitiveMapper
public class DefaultTwoWayKey2StringMapper extends java.lang.Object implements TwoWayKey2StringMapper
Default implementation forTwoWayKey2StringMapperthat knows how to handle all primitive wrapper keys and Strings.- Since:
- 4.1
- Author:
- Mircea.Markus@jboss.com, Tristan Tarrant
-
-
Constructor Summary
Constructors Constructor Description DefaultTwoWayKey2StringMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetKeyMapping(java.lang.String key)Maps a String back to its original keyjava.lang.StringgetStringMapping(java.lang.Object key)Must return an unique String for the supplied key.booleanisSupportedType(java.lang.Class<?> keyType)Do we support this key type?
-
-
-
Method Detail
-
getStringMapping
public java.lang.String getStringMapping(java.lang.Object key)
Description copied from interface:Key2StringMapperMust return an unique String for the supplied key.- Specified by:
getStringMappingin interfaceKey2StringMapper- 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:TwoWayKey2StringMapperMaps a String back to its original key- Specified by:
getKeyMappingin 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
public boolean isSupportedType(java.lang.Class<?> keyType)
Description copied from interface:Key2StringMapperDo we support this key type?- Specified by:
isSupportedTypein interfaceKey2StringMapper- Parameters:
keyType- type to test- Returns:
- true if the type is supported, false otherwise.
-
-