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

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

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

Registration.getInstantiator介绍

暂无

代码示例

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

/** Creates a new instance of a class using {@link Registration#getInstantiator()}. If the registration's instantiator is null,
 * a new one is set using {@link #newInstantiator(Class)}. */
public <T> T newInstance (Class<T> type) {
  Registration registration = getRegistration(type);
  ObjectInstantiator instantiator = registration.getInstantiator();
  if (instantiator == null) {
      instantiator = newInstantiator(type);
    registration.setInstantiator(instantiator);
  }
  return (T)instantiator.newInstance();
}

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

/** Creates a new instance of a class using {@link Registration#getInstantiator()}. If the registration's instantiator is null,
 * a new one is set using {@link #newInstantiator(Class)}. */
public <T> T newInstance (Class<T> type) {
  Registration registration = getRegistration(type);
  ObjectInstantiator instantiator = registration.getInstantiator();
  if (instantiator == null) {
    instantiator = newInstantiator(type);
    registration.setInstantiator(instantiator);
  }
  return (T)instantiator.newInstance();
}

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

/** Creates a new instance of a class using {@link Registration#getInstantiator()}. If the registration's instantiator is null,
 * a new one is set using {@link #newInstantiator(Class)}. */
public <T> T newInstance (Class<T> type) {
  Registration registration = getRegistration(type);
  ObjectInstantiator instantiator = registration.getInstantiator();
  if (instantiator == null) {
    instantiator = newInstantiator(type);
    registration.setInstantiator(instantiator);
  }
  return (T)instantiator.newInstance();
}

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

/** Creates a new instance of a class using {@link Registration#getInstantiator()}. If the registration's instantiator is null,
 * a new one is set using {@link #newInstantiator(Class)}. */
public <T> T newInstance (Class<T> type) {
  Registration registration = getRegistration(type);
  ObjectInstantiator instantiator = registration.getInstantiator();
  if (instantiator == null) {
    instantiator = newInstantiator(type);
    registration.setInstantiator(instantiator);
  }
  return (T)instantiator.newInstance();
}

相关文章