Class WrappedByteArrayOrPrimitiveMapper
java.lang.Object
org.infinispan.persistence.keymappers.DefaultTwoWayKey2StringMapper
org.infinispan.persistence.keymappers.WrappedByteArrayOrPrimitiveMapper
- All Implemented Interfaces:
Key2StringMapper,MarshallingTwoWayKey2StringMapper,TwoWayKey2StringMapper
public class WrappedByteArrayOrPrimitiveMapper
extends DefaultTwoWayKey2StringMapper
implements MarshallingTwoWayKey2StringMapper
This class is an implementation for
TwoWayKey2StringMapper that supports both primitives
and WrappedByteArrays. It extends DefaultTwoWayKey2StringMapper
to achieve this.- Since:
- 5.2
- Author:
- Justin Hayes
-
Constructor Summary
Constructors -
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.booleanisSupportedType(Class<?> keyType) Do we support this key type?voidsetMarshaller(StreamingMarshaller marshaller) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.persistence.keymappers.MarshallingTwoWayKey2StringMapper
setMarshaller
-
Constructor Details
-
WrappedByteArrayOrPrimitiveMapper
public WrappedByteArrayOrPrimitiveMapper()
-
-
Method Details
-
setMarshaller
- Specified by:
setMarshallerin interfaceMarshallingTwoWayKey2StringMapper
-
getStringMapping
Description copied from interface:Key2StringMapperMust return an unique String for the supplied key.- Specified by:
getStringMappingin interfaceKey2StringMapper- Overrides:
getStringMappingin classDefaultTwoWayKey2StringMapper- Parameters:
key- key to map to a String- Returns:
- String representation of the key
-
getKeyMapping
Description copied from interface:TwoWayKey2StringMapperMaps a String back to its original key- Specified by:
getKeyMappingin interfaceTwoWayKey2StringMapper- Overrides:
getKeyMappingin classDefaultTwoWayKey2StringMapper- 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:Key2StringMapperDo we support this key type?- Specified by:
isSupportedTypein interfaceKey2StringMapper- Overrides:
isSupportedTypein classDefaultTwoWayKey2StringMapper- Parameters:
keyType- type to test- Returns:
- true if the type is supported, false otherwise.
-