/** * Constructor to be used for writing the snapshot. * * @param serializerInstance an instance of the originating serializer of this snapshot. */ @SuppressWarnings("unchecked") public CompositeTypeSerializerSnapshot(S serializerInstance) { Preconditions.checkNotNull(serializerInstance); this.nestedSerializersSnapshotDelegate = new NestedSerializersSnapshotDelegate(getNestedSerializers(serializerInstance)); this.correspondingSerializerClass = (Class<S>) serializerInstance.getClass(); }
@Internal TypeSerializerSchemaCompatibility<T> internalResolveSchemaCompatibility( TypeSerializer<T> newSerializer, TypeSerializerSnapshot<?>[] snapshots) { if (newSerializer.getClass() != correspondingSerializerClass) { return TypeSerializerSchemaCompatibility.incompatible(); } S castedNewSerializer = correspondingSerializerClass.cast(newSerializer); // check that outer configuration is compatible; if not, short circuit result if (!isOuterSnapshotCompatible(castedNewSerializer)) { return TypeSerializerSchemaCompatibility.incompatible(); } return constructFinalSchemaCompatibilityResult( getNestedSerializers(castedNewSerializer), snapshots); }