Package org.infinispan.lucene
Class LuceneKey2StringMapper
- java.lang.Object
-
- org.infinispan.lucene.LuceneKey2StringMapper
-
- All Implemented Interfaces:
Key2StringMapper,TwoWayKey2StringMapper
public final class LuceneKey2StringMapper extends Object implements TwoWayKey2StringMapper
To configure a JdbcStringBasedCacheStoreConfig for the Lucene Directory, use this Key2StringMapper implementation.- Since:
- 4.1
- Author:
- Sanne Grinovero
- See Also:
JdbcStringBasedStoreConfigurationBuilder.key2StringMapper(String)
-
-
Constructor Summary
Constructors Constructor Description LuceneKey2StringMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetKeyMapping(String key)This method has to perform the inverse transformation of the keys used in the Lucene Directory from String to object.StringgetStringMapping(Object key)Must return an unique String for the supplied key.booleanisSupportedType(Class<?> keyType)Do we support this key type?
-
-
-
Method Detail
-
isSupportedType
public boolean isSupportedType(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.
-
getStringMapping
public String getStringMapping(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 Object getKeyMapping(String key)
This method has to perform the inverse transformation of the keys used in the Lucene Directory from String to object. So this implementation is strongly coupled to the toString method of each key type.- 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.
- See Also:
ChunkCacheKey.toString(),FileCacheKey.toString(),FileListCacheKey.toString(),FileReadLockKey.toString()
-
-