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

tech.ydb.table.settings.CopyTablesSettings Maven / Gradle / Ivy

package tech.ydb.table.settings;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Maksim Zinal
 */
public class CopyTablesSettings extends RequestSettings {

    private final List items = new ArrayList<>();

    public List getItems() {
        return items;
    }

    public CopyTablesSettings addTable(String sourcePath, String destinationPath,
            boolean omitIndexes) {
        items.add(new Item(sourcePath, destinationPath, omitIndexes));
        return this;
    }

    public CopyTablesSettings addTable(String sourcePath, String destinationPath) {
        items.add(new Item(sourcePath, destinationPath));
        return this;
    }

    public static class Item {
        private final String sourcePath;
        private final String destinationPath;
        private final boolean omitIndexes;

        public Item(String sourcePath, String destinationPath, boolean omitIndexes) {
            this.sourcePath = sourcePath;
            this.destinationPath = destinationPath;
            this.omitIndexes = omitIndexes;
        }

        public Item(String sourcePath, String destinationPath) {
            this.sourcePath = sourcePath;
            this.destinationPath = destinationPath;
            this.omitIndexes = true;
        }

        public String getSourcePath() {
            return sourcePath;
        }

        public String getDestinationPath() {
            return destinationPath;
        }

        public boolean isOmitIndexes() {
            return omitIndexes;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy