com.esotericsoftware.kryo.Registration.setSerializer()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中com.esotericsoftware.kryo.Registration.setSerializer方法的一些代码示例,展示了Registration.setSerializer的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Registration.setSerializer方法的具体详情如下:
包路径:com.esotericsoftware.kryo.Registration
类名称:Registration
方法名:setSerializer

Registration.setSerializer介绍

暂无

代码示例

代码示例来源:origin: com.esotericsoftware/kryo

/** Registers the class using the lowest, next available integer ID and the specified serializer. If the class is already
 * registered, the existing entry is updated with the new serializer. Registering a primitive also affects the corresponding
 * primitive wrapper.
 * <p>
 * Because the ID assigned is affected by the IDs registered before it, the order classes are registered is important when
 * using this method. The order must be the same at deserialization as it was for serialization. */
public Registration register (Class type, Serializer serializer) {
  Registration registration = classResolver.getRegistration(type);
  if (registration != null) {
    registration.setSerializer(serializer);
    return registration;
  }
  return classResolver.register(new Registration(type, serializer, getNextRegistrationId()));
}

代码示例来源:origin: com.esotericsoftware.kryo/kryo

/** Registers the class using the lowest, next available integer ID and the specified serializer. If the class is already
 * registered, the existing entry is updated with the new serializer. Registering a primitive also affects the corresponding
 * primitive wrapper.
 * <p>
 * Because the ID assigned is affected by the IDs registered before it, the order classes are registered is important when
 * using this method. The order must be the same at deserialization as it was for serialization. */
public Registration register (Class type, Serializer serializer) {
  Registration registration = classResolver.getRegistration(type);
  if (registration != null) {
    registration.setSerializer(serializer);
    return registration;
  }
  return classResolver.register(new Registration(type, serializer, getNextRegistrationId()));
}

代码示例来源:origin: com.esotericsoftware/kryo-shaded

/** Registers the class using the lowest, next available integer ID and the specified serializer. If the class is already
 * registered, the existing entry is updated with the new serializer. Registering a primitive also affects the corresponding
 * primitive wrapper.
 * <p>
 * Because the ID assigned is affected by the IDs registered before it, the order classes are registered is important when
 * using this method. The order must be the same at deserialization as it was for serialization. */
public Registration register (Class type, Serializer serializer) {
  Registration registration = classResolver.getRegistration(type);
  if (registration != null) {
    registration.setSerializer(serializer);
    return registration;
  }
  return classResolver.register(new Registration(type, serializer, getNextRegistrationId()));
}

代码示例来源:origin: svn2github/kryo

/** Registers the class using the lowest, next available integer ID and the specified serializer. If the class is already
 * registered, the existing entry is updated with the new serializer. Registering a primitive also affects the corresponding
 * primitive wrapper.
 * <p>
 * Because the ID assigned is affected by the IDs registered before it, the order classes are registered is important when
 * using this method. The order must be the same at deserialization as it was for serialization. */
public Registration register (Class type, Serializer serializer) {
  Registration registration = classResolver.getRegistration(type);
  if (registration != null) {
    registration.setSerializer(serializer);
    return registration;
  }
  return classResolver.register(new Registration(type, serializer, getNextRegistrationId()));
}

相关文章