com.vladkrava.converter.TargetConverter 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;
import com.vladkrava.converter.serialization.DataSerializationException;
/**
* Converting data between 2 types where T is target type and E is a source with providing a target type
*
* @author Vlad Krava - [email protected]
* @see DataSerializationException
* @since 0.1-SNAPSHOT
*/
public interface TargetConverter {
/**
* Data converting specification
*
* @param e - source data
* @param aClass - converted data class type
* @return T - converted data in a target datatype
* @throws DataSerializationException - on any exception with serialization from source datatype to a byte array
*/
T convert(final E e, final Class aClass) throws DataSerializationException;
}