Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.loaders.keymappers
Class MarshalledValueOrPrimitiveMapper

java.lang.Object
  extended by org.infinispan.loaders.keymappers.DefaultTwoWayKey2StringMapper
      extended by org.infinispan.loaders.keymappers.MarshalledValueOrPrimitiveMapper
All Implemented Interfaces:
Key2StringMapper, MarshallingTwoWayKey2StringMapper, TwoWayKey2StringMapper

public class MarshalledValueOrPrimitiveMapper
extends DefaultTwoWayKey2StringMapper
implements MarshallingTwoWayKey2StringMapper

This class is an implementation for TwoWayKey2StringMapper that supports both primitives and MarshalledValues. It extends DefaultTwoWayKey2StringMapper to achieve this.

Since:
5.2
Author:
Justin Hayes

Constructor Summary
MarshalledValueOrPrimitiveMapper()
           
 
Method Summary
 Object getKeyMapping(String key)
          Maps a String back to its original key
 String getStringMapping(Object key)
          Must return an unique String for the supplied key.
 boolean isSupportedType(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
 

Constructor Detail

MarshalledValueOrPrimitiveMapper

public MarshalledValueOrPrimitiveMapper()
Method Detail

setMarshaller

public void setMarshaller(StreamingMarshaller marshaller)
Specified by:
setMarshaller in interface MarshallingTwoWayKey2StringMapper

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
Overrides:
getStringMapping in class DefaultTwoWayKey2StringMapper
Parameters:
key - key to map to a String
Returns:
String representation of the key

getKeyMapping

public Object getKeyMapping(String key)
Description copied from interface: TwoWayKey2StringMapper
Maps a String back to its original key

Specified by:
getKeyMapping in interface TwoWayKey2StringMapper
Overrides:
getKeyMapping in class DefaultTwoWayKey2StringMapper
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(Class<?> keyType)
Description copied from interface: Key2StringMapper
Do we support this key type?

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

Infinispan Distribution 5.2.6.Final-redhat-2

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