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

import java.util.List;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import org.springblade.etl.connector.base.SeatunnelConfig;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author wookvn
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SeatunnelReplaceTransformConfig extends SeatunnelConfig{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@NotEmpty(message = "替换组件：字段名不能为空")
	@ApiModelProperty("字段名")
	private String column;
	
	@ApiModelProperty("不满足条件时默认替换的值，不设置使用原值")
	private String defaultValue;
	
	@NotNull(message = "替换组件：替换条件不能为空")
	private List<Condition> conditions;

	@Data
	public static class Condition {
		@ApiModelProperty("是否包含字符串")
		private Boolean isContains;
		@ApiModelProperty("替换条件字符串")
		private String compareValue;
		@ApiModelProperty("替换成的值")
		private String replacement;
		@ApiModelProperty("是否覆盖替换[false-替换匹配到的值]")
		private Boolean isCover = false;
	}
}
