@Deprecated static Schema<GenericRecord> AUTO() { return AUTO_CONSUME(); }
@Deprecated static Schema<GenericRecord> AUTO() { return AUTO_CONSUME(); }
@SuppressWarnings("unchecked") private static <T> Schema<T> newSchemaInstance(Class<T> clazz, SchemaType type) { switch (type) { case NONE: return (Schema<T>) Schema.BYTES; case AUTO_CONSUME: case AUTO: return (Schema<T>) Schema.AUTO_CONSUME(); case STRING: return (Schema<T>) Schema.STRING; case AVRO: return AvroSchema.of(clazz); case JSON: return JSONSchema.of(clazz); case PROTOBUF: return ProtobufSchema.ofGenericClass(clazz, Collections.emptyMap()); default: throw new RuntimeException("Unsupported schema type" + type); } }