class LinkFormatCodec implements ContentCodec {

    @Override
    public <T> T bytesToValue(byte[] body,
                              DataSchema<T> schema,
                              Map<String, String> parameters) throws ContentCodecException {
        Pattern pattern = Pattern.compile("^(.+)=\"(.+)\"");
        if (schema.getType().equals("object")) {
            Map<String, Map<String, String>> entries = new HashMap<>();

            String bodyString = new String(body);
            String[] entriesString = bodyString.split(",");
            for (String entryString : entriesString) {
                List<String> entryComponentsString = new ArrayList(Arrays.asList(entryString.split(";", 4)));
                String entryKey = entryComponentsString.remove(0);

                Map<String, String> entryParameters = new HashMap<>();
                entryComponentsString.forEach(s -> {
                    Matcher matcher = pattern.matcher(s);
                    if (matcher.find()) {
                        String key = matcher.group(1);
                        String value = matcher.group(2);
                        entryParameters.put(key, value);
                    }
                });

                entries.put(entryKey, entryParameters);
            }
            return (T) entries;
        }
        else {
            throw new ContentCodecException("Non-object data schema not implemented yet");
        }
    }

}