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

com.alipay.rdf.file.spi.RdfFileRowCodecSpi Maven / Gradle / Ivy

There is a newer version: 2.2.11
Show newest version
package com.alipay.rdf.file.spi;

import com.alipay.rdf.file.meta.FileColumnMeta;
import com.alipay.rdf.file.model.FileConfig;
import com.alipay.rdf.file.protocol.RowDefinition;
import com.alipay.rdf.file.util.BeanMapWrapper;

import java.util.List;

/**
 *
 * 用于对行记录的序列/反序列化扩展
 *
 * @Author: hongwei.quhw 2021/6/27 2:51 下午
 */
public interface RdfFileRowCodecSpi {

    String serialize(RowCodecContext ctx);

    String postSerialize(String line, RowCodecContext ctx);

    String preDeserialize(String line, RowCodecContext ctx);

    void deserialize(String line, RowCodecContext ctx);

    public static class RowCodecContext {
        public final BeanMapWrapper bmw;
        public final FileConfig fileConfig;
        public List columnMetas;
        public final RowDefinition rd;
        public String[] columnValues;
        public Object ext;

        public RowCodecContext(BeanMapWrapper bmw, FileConfig fileConfig, List columnMetas, RowDefinition rd) {
            this.bmw = bmw;
            this.fileConfig = fileConfig;
            this.columnMetas = columnMetas;
            this.rd = rd;
            this.columnValues = null;
        }

        public RowCodecContext(BeanMapWrapper bmw, FileConfig fileConfig, List columnMetas, RowDefinition rd, String[] columnValues) {
            this.bmw = bmw;
            this.fileConfig = fileConfig;
            this.columnMetas = columnMetas;
            this.rd = rd;
            this.columnValues = columnValues;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy