com.adgear.anoa.write.ThriftWriter Maven / Gradle / Ivy
package com.adgear.anoa.write;
import com.adgear.anoa.AnoaReflectionUtils;
import com.fasterxml.jackson.core.JsonGenerator;
import org.apache.thrift.TBase;
import org.apache.thrift.TFieldIdEnum;
import org.apache.thrift.meta_data.FieldValueMetaData;
import org.apache.thrift.meta_data.ListMetaData;
import org.apache.thrift.meta_data.MapMetaData;
import org.apache.thrift.meta_data.SetMetaData;
import org.apache.thrift.meta_data.StructMetaData;
import org.apache.thrift.protocol.TType;
import org.jooq.lambda.Unchecked;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
class ThriftWriter> extends AbstractRecordWriter {
final Map> fieldWriters;
final Map fieldDefaults;
@SuppressWarnings("unchecked")
ThriftWriter(Class thriftClass) {
fieldWriters = new LinkedHashMap<>();
fieldDefaults = new HashMap<>();
T defaultInstance = createDefaultValue(thriftClass);
AnoaReflectionUtils.getThriftMetaDataMap(thriftClass).forEach((f, md) -> {
fieldWriters.put(f, (AbstractWriter
© 2015 - 2025 Weber Informatics LLC | Privacy Policy