@Override public JavaEitherSerializerSnapshot<L, R> snapshotConfiguration() { return new JavaEitherSerializerSnapshot<>(this); } }
@Override @SuppressWarnings("unchecked") public TypeSerializerSchemaCompatibility<Either<L, R>> resolveSchemaCompatibility( TypeSerializer<Either<L, R>> newSerializer) { // this class was shared between the Java Either Serializer and the // Scala Either serializer if (newSerializer.getClass() == EitherSerializer.class) { List<Tuple2<TypeSerializer<?>, TypeSerializerSnapshot<?>>> nestedSerializersAndConfigs = getNestedSerializersAndConfigs(); return CompositeTypeSerializerUtil.delegateCompatibilityCheckToNewSnapshot( newSerializer, new JavaEitherSerializerSnapshot<>(), nestedSerializersAndConfigs.get(0).f1, nestedSerializersAndConfigs.get(1).f1); } else { // Scala Either Serializer, or other. // fall back to the backwards compatibility path return super.resolveSchemaCompatibility(newSerializer); } } }
@Override public TypeSerializerSchemaCompatibility<Either<L, R>> resolveSchemaCompatibility( TypeSerializer<Either<L, R>> newSerializer) { checkState(nestedSnapshot != null); if (newSerializer instanceof EitherSerializer) { // delegate compatibility check to the new snapshot class return CompositeTypeSerializerUtil.delegateCompatibilityCheckToNewSnapshot( newSerializer, new JavaEitherSerializerSnapshot<>(), nestedSnapshot.getNestedSerializerSnapshots()); } else { return TypeSerializerSchemaCompatibility.incompatible(); } } }