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

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

/**
 * @author wookvn
 *
 */
@Component
public class PlatomixNullReplaceTransform implements SeatunnelConnector<SeatunnelNullReplaceTransformConfig> {

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

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

}
