private static Object projectRequiredSchema(Schema source, Object record, Schema target) throws SchemaProjectorException {
        switch (target.type()) {
            case INT8:
            case INT16:
            case INT32:
            case INT64:
            case FLOAT32:
            case FLOAT64:
            case BOOLEAN:
            case BYTES:
            case STRING:
                return projectPrimitive(source, record, target);
            case STRUCT:
                return projectStruct(source, (Struct) record, target);
            case ARRAY:
                return projectArray(source, record, target);
            case MAP:
                return projectMap(source, record, target);
        }
        return null;
    }
This method projects a value between compatible schemas and throws exceptions when non-compatible schemas are provided
@param source the schema used to construct the record
@param record the value to project from source schema to target schema
@param target the schema to project the record to
@return the projected value with target schema
@throws SchemaProjectorException if the target schema is not optional and does not have a default value
connect/api/src/main/java/org/apache/kafka/connect/data/SchemaProjector.java