org.infinispan.lucene
Class LuceneKey2StringMapper

java.lang.Object
  extended by org.infinispan.lucene.LuceneKey2StringMapper
All Implemented Interfaces:
Key2StringMapper, TwoWayKey2StringMapper

public 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:
JdbcStringBasedCacheStoreConfig.setKey2StringMapperClass(String)

Constructor Summary
LuceneKey2StringMapper()
           
 
Method Summary
 Object getKeyMapping(String key)
          This method has to perform the inverse transformation of the keys used in the Lucene Directory from String to object.
 String getStringMapping(Object key)
          Must return an unique String for the supplied key.
 boolean isSupportedType(Class<?> keyType)
          Do we support this key type?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneKey2StringMapper

public LuceneKey2StringMapper()
Method Detail

isSupportedType

public boolean isSupportedType(Class<?> keyType)
Description copied from interface: Key2StringMapper
Do we support this key type?

Specified by:
isSupportedType in interface Key2StringMapper
Parameters:
keyType - type to test
Returns:
true if the type is supported, false otherwise.

getStringMapping

public String getStringMapping(Object key)
Description copied from interface: Key2StringMapper
Must return an unique String for the supplied key.

Specified by:
getStringMapping in interface Key2StringMapper
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:
getKeyMapping in interface TwoWayKey2StringMapper
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()

-->

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.