@Override protected Collection createCopy(Kryo kryo, Collection original) { return kryo.newInstance(this.type); } }
@Override protected Collection create(Kryo kryo, Input input, Class<Collection> type) { return kryo.newInstance(this.type); }
@Override public T createInstance() { if(Modifier.isAbstract(type.getModifiers()) || Modifier.isInterface(type.getModifiers()) ) { return null; } else { checkKryoInitialized(); try { return kryo.newInstance(type); } catch(Throwable e) { return null; } } }
SerializationException ex = null; try { return super.newInstance(type); } catch (SerializationException se) { ex = se;
/** Used by {@link #read(Kryo, Input, Class)} to create the new object. This can be overridden to customize object creation, eg * to call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected Collection create (Kryo kryo, Input input, Class<Collection> type) { return kryo.newInstance(type); }
/** Used by {@link #read(Kryo, Input, Class)} to create the new object. This can be overridden to customize object creation, eg * to call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected Map create (Kryo kryo, Input input, Class<Map> type) { return kryo.newInstance(type); }
/** Used by {@link #read(Kryo, Input, Class)} to create the new object. This can be overridden to customize object creation, eg * to call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected T create (Kryo kryo, Input input, Class<T> type) { return kryo.newInstance(type); }
/** Used by {@link #read(Kryo, Input, Class)} to create the new object. This can be overridden to customize object creation, eg * to call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected Map create (Kryo kryo, Input input, Class<Map> type) { return kryo.newInstance(type); }
/** Used by {@link #read(Kryo, Input, Class)} to create the new object. This can be overridden to customize object creation, eg * to call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected T create (Kryo kryo, Input input, Class<T> type) { return kryo.newInstance(type); }
/** Used by {@link #read(Kryo, Input, Class)} to create the new object. This can be overridden to customize object creation, eg * to call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected Collection create (Kryo kryo, Input input, Class<Collection> type) { return kryo.newInstance(type); }
/** Used by {@link #read(Kryo, Input, Class)} to create the new object. This can be overridden to customize object creation, eg * to call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected T create (Kryo kryo, Input input, Class<T> type) { return kryo.newInstance(type); }
/** Used by {@link #copy(Kryo, Object)} to create the new object. This can be overridden to customize object creation, eg to * call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected T createCopy (Kryo kryo, T original) { return (T)kryo.newInstance(original.getClass()); }
/** Used by {@link #copy(Kryo, Collection)} to create the new object. This can be overridden to customize object creation, eg * to call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected Collection createCopy (Kryo kryo, Collection original) { return kryo.newInstance(original.getClass()); }
/** Used by {@link #copy(Kryo, Collection)} to create the new object. This can be overridden to customize object creation, eg to * call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected Collection createCopy (Kryo kryo, Collection original) { return kryo.newInstance(original.getClass()); }
/** Used by {@link #copy(Kryo, Object)} to create the new object. This can be overridden to customize object creation, eg to * call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected T createCopy (Kryo kryo, T original) { return (T)kryo.newInstance(original.getClass()); }
/** Used by {@link #copy(Kryo, Collection)} to create the new object. This can be overridden to customize object creation, eg * to call a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. */ protected Collection createCopy (Kryo kryo, Collection original) { return kryo.newInstance(original.getClass()); }
@SuppressWarnings("unchecked") @Override public DynamicInvokable<MemberType, DeclaringType, ReturnType> copy(final Kryo kryo) { final DynamicInvokable<MemberType, DeclaringType, ReturnType> copy = kryo.newInstance(this.getClass()); ReflectUtil.setField(copy, DynamicInvokable.class, "name", this.name); copy.originalSignatures.putAll(this.originalSignatures); return copy; }
@Override public T read(final Kryo kryo, final Input input, final Class<T> type) { try { final T object = kryo.newInstance(type); kryo.reference(object); object.readFields(new DataInputStream(input)); return object; } catch (final IOException e) { throw new RuntimeException("unable to deserialize Writable object", e); } } }
public KryoSerializable read (Kryo kryo, Input input, Class<KryoSerializable> type) { KryoSerializable object = kryo.newInstance(type); kryo.reference(object); object.read(kryo, input); return object; } }
public KryoSerializable read (Kryo kryo, Input input, Class<KryoSerializable> type) { KryoSerializable object = kryo.newInstance(type); kryo.reference(object); object.read(kryo, input); return object; } }