class ContentManager {

    public static <T> T contentToValue(Content content,
                                       DataSchema<T> schema) throws ContentCodecException {
        if (content == null || content.getBody().length == 0) {
            return null;
        }

        if (schema == null) {
            log.warn("No DataSchema provided. Return null");
            return null;
        }

        String contentType = content.getType();
        if (contentType == null) {
            // default to text/plain
            contentType = DEFAULT;
            log.warn("No content type given. Use default one: {}", DEFAULT);
        }

        String mediaType = getMediaType(contentType);
        Map<String, String> parameters = getMediaTypeParameters(contentType);

        // choose codec based on mediaType
        ContentCodec codec = CODECS.get(mediaType);

        if (codec != null) {
            log.debug("Content deserializing from '{}'", mediaType);
            return codec.bytesToValue(content.getBody(), schema, parameters);
        }
        else {
            log.warn("Content passthrough due to unsupported media type '{}'", mediaType);
            return fallbackBytesToValue(content, schema);
        }
    }

    private  ContentManager();

}