Package org.ehcache.impl.copy
Class SerializingCopier<T>
java.lang.Object
org.ehcache.impl.copy.ReadWriteCopier<T>
org.ehcache.impl.copy.SerializingCopier<T>
- All Implemented Interfaces:
org.ehcache.spi.copy.Copier<T>
A helper copier implementation that performs the "copying" using
serialization.-
Constructor Summary
ConstructorsConstructorDescriptionSerializingCopier(org.ehcache.spi.serialization.Serializer<T> serializer) Creates a new copier that will using the providedSerializer. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Class<? extends org.ehcache.spi.copy.Copier<T>>Convenience method allowing to represent this copier's class as the expected type in configuration.Returns a copy of the passed in instance by serializing and deserializing it.org.ehcache.spi.serialization.Serializer<T>Returns theSerializerused by this copier.Methods inherited from class org.ehcache.impl.copy.ReadWriteCopier
copyForRead, copyForWrite
-
Constructor Details
-
SerializingCopier
Creates a new copier that will using the providedSerializer.- Parameters:
serializer- the serializer to use
-
-
Method Details
-
asCopierClass
Convenience method allowing to represent this copier's class as the expected type in configuration.- Type Parameters:
T- The type to work on- Returns:
- the proper type
-
copy
Returns a copy of the passed in instance by serializing and deserializing it.- Specified by:
copyin classReadWriteCopier<T>- Parameters:
obj- the instance to copy- Returns:
- a copied instance, depending on the implementation
-
getSerializer
Returns theSerializerused by this copier.- Returns:
- the serializer used
-