/**
 * 
 */
package org.springblade.etl.connector.transform;

import org.springblade.etl.connector.base.SeatunnelConnector;
import org.springblade.etl.connector.transform.config.SeatunnelColumnSelectTransformConfig;
import org.springblade.etl.util.EtlJsonUtil;
import org.springblade.etl.util.ValidateUtil;
import org.springframework.stereotype.Component;

/**
 * @author wookvn
 *
 */
@Component
public class PlatomixColumnSelectTransform implements SeatunnelConnector<SeatunnelColumnSelectTransformConfig> {

	@Override
	public SeatunnelColumnSelectTransformConfig buildConfig(String configJson) {
		return (SeatunnelColumnSelectTransformConfig)validate(configJson);
	}

	@Override
	public Object validate(String configJson) {
		SeatunnelColumnSelectTransformConfig config = EtlJsonUtil.parseJsonString(configJson, SeatunnelColumnSelectTransformConfig.class);
		ValidateUtil.validate(config);
		ValidateUtil.validate(config.getFields());
		return config;
	}

}
