本文整理汇总了Java中com.esotericsoftware.kryo.factories.SerializerFactory类的典型用法代码示例。如果您正苦于以下问题:Java SerializerFactory类的具体用法?Java SerializerFactory怎么用?Java SerializerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SerializerFactory类属于com.esotericsoftware.kryo.factories包,在下文中一共展示了SerializerFactory类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDefaultSerializer
import com.esotericsoftware.kryo.factories.SerializerFactory; //导入依赖的package包/类
/** Sets the serializer factory to use when no {@link #addDefaultSerializer(Class, Class) default serializers} match an object's
* type. Default is {@link ReflectionSerializerFactory} with {@link FieldSerializer}.
* @see #newDefaultSerializer(Class) */
public void setDefaultSerializer (SerializerFactory serializer) {
if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
defaultSerializer = serializer;
}
示例2: addDefaultSerializer
import com.esotericsoftware.kryo.factories.SerializerFactory; //导入依赖的package包/类
public void addDefaultSerializer (Class type, SerializerFactory serializerFactory) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
if (serializerFactory == null) throw new IllegalArgumentException("serializerFactory cannot be null.");
DefaultSerializerEntry entry = new DefaultSerializerEntry(type, serializerFactory);
defaultSerializers.add(defaultSerializers.size() - lowPriorityDefaultSerializerCount, entry);
}
示例3: DefaultSerializerEntry
import com.esotericsoftware.kryo.factories.SerializerFactory; //导入依赖的package包/类
DefaultSerializerEntry (Class type, SerializerFactory serializerFactory) {
this.type = type;
this.serializerFactory = serializerFactory;
}