@Override public ValueSerializer<T> duplicate() { return new ValueSerializer<T>(type); }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); // kryoRegistrations may be null if this value serializer is deserialized from an old version if (kryoRegistrations == null) { this.kryoRegistrations = asKryoRegistrations(type); } }
@Override public boolean equals(Object obj) { if (obj instanceof ValueSerializer) { ValueSerializer<?> other = (ValueSerializer<?>) obj; return other.canEqual(this) && type == other.type; } else { return false; } }
@Override public T deserialize(DataInputView source) throws IOException { return deserialize(createInstance(), source); }
@Override public T copy(T from) { checkKryoInitialized(); return KryoUtils.copy(from, kryo, this); }
@Override public T deserialize(DataInputView source) throws IOException { return deserialize(createInstance(), source); }
@Override public T copy(T from, T reuse) { checkKryoInitialized(); return KryoUtils.copy(from, reuse, kryo, this); }
@Override protected TypeSerializer<ValueID> createSerializer() { return new ValueSerializer<>(ValueID.class); }
@Override public T deserialize(DataInputView source) throws IOException { return deserialize(createInstance(), source); }
@Override public T copy(T from) { checkKryoInitialized(); return KryoUtils.copy(from, kryo, this); }
public ValueSerializer(Class<T> type) { this.type = checkNotNull(type); this.kryoRegistrations = asKryoRegistrations(type); }
@Override public boolean equals(Object obj) { if (obj instanceof ValueSerializer) { ValueSerializer<?> other = (ValueSerializer<?>) obj; return other.canEqual(this) && type == other.type; } else { return false; } }
@Override protected TypeSerializer<ValueID> createSerializer() { return new ValueSerializer<>(ValueID.class); }
@Override public T copy(T from, T reuse) { checkKryoInitialized(); return KryoUtils.copy(from, reuse, kryo, this); }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); // kryoRegistrations may be null if this value serializer is deserialized from an old version if (kryoRegistrations == null) { this.kryoRegistrations = asKryoRegistrations(type); } }
@Override public boolean equals(Object obj) { if (obj instanceof ValueSerializer) { ValueSerializer<?> other = (ValueSerializer<?>) obj; return other.canEqual(this) && type == other.type; } else { return false; } }
@Override protected TypeSerializer<StringValue> createSerializer() { return new ValueSerializer<StringValue>(StringValue.class); }
@Override public T copy(T from, T reuse) { checkKryoInitialized(); return KryoUtils.copy(from, reuse, kryo, this); }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); // kryoRegistrations may be null if this value serializer is deserialized from an old version if (kryoRegistrations == null) { this.kryoRegistrations = asKryoRegistrations(type); } }
@Override public void setReference(T toCompare) { checkKryoInitialized(); reference = KryoUtils.copy(toCompare, kryo, new ValueSerializer<T>(type)); }