public class DefaultSerializerConfiguration<T> extends org.ehcache.impl.internal.classes.ClassInstanceConfiguration<Serializer<T>> implements ServiceConfiguration<SerializationProvider,java.lang.Void>
ServiceConfiguration
for the default SerializationProvider
.
This class overrides the default ServiceConfiguration.compatibleWith(ServiceConfiguration)
implementation
to allow for independent configuration of the key and value serializers.
Modifier and Type | Class and Description |
---|---|
static class |
DefaultSerializerConfiguration.Type
Serialization provider types
|
Constructor and Description |
---|
DefaultSerializerConfiguration(java.lang.Class<? extends Serializer<T>> clazz,
DefaultSerializerConfiguration.Type type)
Creates a new serializer configuration with the given
Serializer class and type . |
DefaultSerializerConfiguration(Serializer<T> serializer,
DefaultSerializerConfiguration.Type type)
Creates a new serializer configuration with the given
Serializer instance and type . |
Modifier and Type | Method and Description |
---|---|
boolean |
compatibleWith(ServiceConfiguration<?,?> other)
Returns true if this configuration can co-exist with
other in the same cache configuration. |
java.lang.Class<SerializationProvider> |
getServiceType()
Indicates which service this configuration works with.
|
DefaultSerializerConfiguration.Type |
getType()
Get the type of the serializer configured
|
getArguments, getClazz, getInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
build, derive
public DefaultSerializerConfiguration(java.lang.Class<? extends Serializer<T>> clazz, DefaultSerializerConfiguration.Type type)
Serializer
class and type
.clazz
- the serializer classtype
- the serializer typepublic DefaultSerializerConfiguration(Serializer<T> serializer, DefaultSerializerConfiguration.Type type)
Serializer
instance and type
.serializer
- the serializer instancetype
- the serializer typepublic java.lang.Class<SerializationProvider> getServiceType()
getServiceType
in interface ServiceConfiguration<SerializationProvider,java.lang.Void>
public DefaultSerializerConfiguration.Type getType()
public boolean compatibleWith(ServiceConfiguration<?,?> other)
ServiceConfiguration
other
in the same cache configuration.
The default implementation of compatibleWith
(as used by many of the implementations) considers any
instance of the same type (or a sub-type) to be incompatible with this instance.
compatibleWith
in interface ServiceConfiguration<SerializationProvider,java.lang.Void>
other
- other service configurationtrue
if the two configurations are compatible