All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vladkrava.converter.http.AvroToJsonHttpMessageConverter Maven / Gradle / Ivy

Go to download

Enables conversion of Apache Avro object into popular data formats: JSON, XML, etc

There is a newer version: 1.0.1
Show newest version
package com.vladkrava.converter.http;

import static org.springframework.http.converter.StringHttpMessageConverter.DEFAULT_CHARSET;

import org.apache.avro.specific.SpecificRecordBase;
import org.springframework.http.MediaType;

/**
 * This converter supports application/avro-json format with {@code DEFAULT_CHARSET} character set.
 *
 * @author Vlad Krava - [email protected]
 * @see AbstractAvroHttpMessageConverter
 * @see SpecificRecordBase
 * @since 0.1-SNAPSHOT
 */
public class AvroToJsonHttpMessageConverter extends AbstractAvroHttpMessageConverter {
    private static final String MEDIA_TYPE = "application";
    private static final String MEDIA_SUB_TYPE = "avro-json";

    private static final MediaType AVRO_JSON_MEDIA_TYPE = new MediaType(MEDIA_TYPE, MEDIA_SUB_TYPE, DEFAULT_CHARSET);

    public AvroToJsonHttpMessageConverter() {
        super(AVRO_JSON_MEDIA_TYPE);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy