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

com.datastax.data.prepare.spark.dataset.params.ReplaceAttribute Maven / Gradle / Ivy

package com.datastax.data.prepare.spark.dataset.params;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ReplaceAttribute extends Attributes {

    private List filterSections = new ArrayList<>();
    private List valueReplaceAttributes = new ArrayList<>();

    public ReplaceAttribute() {}

    public class ValueReplaceAttribute implements Serializable {
        private boolean regex;
        private String oldValue;
        private String newValue;

        private ValueReplaceAttribute() {}

        private ValueReplaceAttribute(boolean regex, String oldValue, String newValue) {
            this.regex = regex;
            this.oldValue = oldValue;
            this.newValue = newValue;
        }

        public boolean isRegex() {
            return regex;
        }

        public void setRegex(boolean regex) {
            this.regex = regex;
        }

        public String getOldValue() {
            return oldValue;
        }

        public void setOldValue(String oldValue) {
            this.oldValue = oldValue;
        }

        public String getNewValue() {
            return newValue;
        }

        public void setNewValue(String newValue) {
            this.newValue = newValue;
        }
    }


    public List getFilterSections() {
        return filterSections;
    }

    public void addFilterSections(FilterSection filterSection) {
        this.filterSections.add(filterSection);
    }

    public List getValueReplaceAttributes() {
        return valueReplaceAttributes;
    }

    public void addValueReplaceAttributes(boolean regex, String oldValue, String newValue) {
        this.valueReplaceAttributes.add(new ValueReplaceAttribute(regex, oldValue, newValue));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy