private static Struct convertToStructInternal(Schema toSchema, Object value) {
        if (value == null) {
            throw new DataException("Unable to convert a null value to a schema that requires a value");
        } else if (value instanceof Struct) {
            return (Struct) value;
        }
        throw new DataException("Unable to convert " + value + " (" + value.getClass() + ") to " + toSchema);
    }
Convert the value to the desired type.

@param toSchema   the schema for the desired type; may not be null
@param fromSchema the schema for the supplied value; may be null if not known
@return the converted value; null if the passed-in schema was optional, and the input value was null.
@throws DataException if the value could not be converted to the desired type
connect/api/src/main/java/org/apache/kafka/connect/data/Values.java