All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.atleon.schemaregistry.confluent.ParsedSchemas Maven / Gradle / Ivy

There is a newer version: 0.28.3
Show newest version
package io.atleon.schemaregistry.confluent;

import io.confluent.kafka.schemaregistry.ParsedSchema;

final class ParsedSchemas {

    private ParsedSchemas() {

    }

    public static  S extractTypedRawSchema(ParsedSchema parsedSchema, Class type) {
        Object rawSchema = parsedSchema.rawSchema();
        if (type.isInstance(rawSchema)) {
            return type.cast(rawSchema);
        } else {
            throw new IllegalArgumentException("Expected schema to be of type=" + type + " but got rawSchema=" + rawSchema);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy