package io.monokkel.configuration; import java.util.List; public class CrawlerConfigurationBuilder { private List<String> filters; private String indexName; private String indexType; private String indexNodeHost; private Integer indexNodePort; private Long maxDuration; private List<String> seedUrls; private String contentRetrievalExpression; private String attributeToLocateContent; private boolean createEmbeddedElasticNode; private Integer maxDepth; private String transformationPath; private String cleanDataFilePath; private Integer seconds; private Integer urlsPer; private Boolean disableThrottle; private String validatorPath; private String jsonTransformationPath; private List<String> fieldToFiendNextUrl; private Boolean jsonTransformationEnabled; private Boolean shouldIndexRawContent; public CrawlerConfigurationBuilder setFilters(List<String> filters) { this.filters = filters; return this; } public CrawlerConfigurationBuilder setIndexName(String indexName) { this.indexName = indexName; return this; } public CrawlerConfigurationBuilder setIndexType(String indexType) { this.indexType = indexType; return this; } public CrawlerConfigurationBuilder setIndexNodeHost(String indexNodeHost) { this.indexNodeHost = indexNodeHost; return this; } public CrawlerConfigurationBuilder setIndexNodePort(Integer indexNodePort) { this.indexNodePort = indexNodePort; return this; } public CrawlerConfigurationBuilder setMaxDuration(Long maxDuration) { this.maxDuration = maxDuration; return this; } public CrawlerConfigurationBuilder setSeedUrls(List<String> seedUrls) { this.seedUrls = seedUrls; return this; } public CrawlerConfigurationBuilder setContentRetrievalExpression(String contentRetrievalExpression) { this.contentRetrievalExpression = contentRetrievalExpression; return this; } public CrawlerConfigurationBuilder setAttributeToLocateContent(String attributeToLocateContent) { this.attributeToLocateContent = attributeToLocateContent; return this; } public CrawlerConfigurationBuilder setCreateEmbeddedElasticNode(boolean createEmbeddedElasticNode) { this.createEmbeddedElasticNode = createEmbeddedElasticNode; return this; } public CrawlerConfigurationBuilder setMaxDepth(Integer maxDepth) { this.maxDepth = maxDepth; return this; } public CrawlerConfigurationBuilder setTransformationPath(String transformationPath) { this.transformationPath = transformationPath; return this; } public CrawlerConfigurationBuilder setCleanDataFilePath(String cleanDataFilePath) { this.cleanDataFilePath = cleanDataFilePath; return this; } public CrawlerConfigurationBuilder setSeconds(Integer seconds) { this.seconds = seconds; return this; } public CrawlerConfigurationBuilder setUrlsPer(Integer urlsPer) { this.urlsPer = urlsPer; return this; } public CrawlerConfigurationBuilder setDisableThrottle(Boolean disableThrottle) { this.disableThrottle = disableThrottle; return this; } public CrawlerConfigurationBuilder setValidatorPath(String validatorPath) { this.validatorPath = validatorPath; return this; } public CrawlerConfigurationBuilder setJsonTransformationPath(final String jsonTransformationPath) { this.jsonTransformationPath = jsonTransformationPath; return this; } public CrawlerConfigurationBuilder setFieldToFindNextUrl(List<String> fieldToFiendNextUrl) { this.fieldToFiendNextUrl = fieldToFiendNextUrl; return this; } public CrawlerConfigurationBuilder setJsonTransformationEnabled(Boolean jsonTransformationEnabled) { this.jsonTransformationEnabled = jsonTransformationEnabled; return this; } public CrawlerConfigurationBuilder setShouldIndexRawContent(Boolean shouldIndexRawContent) { this.shouldIndexRawContent = shouldIndexRawContent; return this; } public CrawlerConfiguration createCrawlerConfiguration() { return new CrawlerConfiguration(filters, indexName, indexType, indexNodeHost, indexNodePort, maxDuration, seedUrls, contentRetrievalExpression, attributeToLocateContent, createEmbeddedElasticNode, maxDepth, transformationPath, cleanDataFilePath, seconds, urlsPer, disableThrottle, validatorPath, jsonTransformationPath, fieldToFiendNextUrl, jsonTransformationEnabled, shouldIndexRawContent); } }