com.vladkrava.converter.http.AvroToJsonHttpMessageConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of avro-converter Show documentation
Show all versions of avro-converter Show documentation
Enables conversion of Apache Avro object into popular data formats: JSON, XML, etc
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);
}
}