public static Value deserializeValue()

in store/src/main/java/com/epam/eco/schemacatalog/store/schema/kafka/SchemaRegistrySerde.java [92:117]


    public static Value deserializeValue(Key key, byte[] valueBytes) throws SchemaRegistrySerdeException {
        if (valueBytes == null) {
            return null;
        }

        try {
            if (KeyType.CONFIG == key.getKeytype()) {
                return MAPPER.readValue(valueBytes, ConfigValue.class);
            } else if (KeyType.SCHEMA == key.getKeytype()) {
                return MAPPER.readValue(valueBytes, SchemaValue.class);
            } else if (KeyType.DELETE_SUBJECT == key.getKeytype()) {
                return MAPPER.readValue(valueBytes, DeleteSubjectValue.class);
            } else if (KeyType.MODE == key.getKeytype()) {
                return MAPPER.readValue(valueBytes, ModeValue.class);
            } else if (KeyType.CLEAR_SUBJECT == key.getKeytype()) {
                return MAPPER.readValue(valueBytes, ClearSubjectValue.class);
            } else {
                throw new SchemaRegistrySerdeException(
                        String.format(
                                "Can't deserialize schema registry value, key type %s not supported",
                                key.getKeytype().name()));
            }
        } catch (IOException ioe) {
            throw new SchemaRegistrySerdeException("Failed to deserialize schema registry value", ioe);
        }
    }