![JAR search and dependency download from the Maven repository](/logo.png)
com.at.avro.formatters.DateFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of avro-schema-generator Show documentation
Show all versions of avro-schema-generator Show documentation
Library for generating avro schema files (.avsc) based on DB tables structure
The newest version!
package com.at.avro.formatters;
import com.at.avro.config.FormatterConfig;
import com.at.avro.types.Date;
/**
* @author [email protected]
*/
public class DateFormatter implements Formatter {
@Override
public String toJson(Date date, FormatterConfig config) {
String template = "{ \"type\":\"%s\", \"logicalType\":\"%s\", \"java-class\":\"%s\" }".replaceAll(":", config.colon());
return String.format(template, date.getPrimitiveType(), date.getLogicalType(), date.getJavaClass());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy