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

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

/**
 * @author wookvn
 *
 */
@Component
public class PlatomixReplaceTransform implements SeatunnelConnector<SeatunnelReplaceTransformConfig> {

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

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