io.github.asewhy.exchange.base.ExchangeSimpleTaskFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of exchange Show documentation
Show all versions of exchange Show documentation
Simple module for exchange data in xlsx or csv
The newest version!
package io.github.asewhy.exchange.base;
import io.github.asewhy.exchange.support.ExchangeTaskFactory;
import java.util.function.Supplier;
/**
* Класс фабрики задач
* @param тип задачи
*/
public class ExchangeSimpleTaskFactory implements ExchangeTaskFactory {
/** Метод, возвращающий задачу экспорта */
protected final Supplier> supplier;
/** Тип задачи */
protected final Class extends ExchangeProcessorTask> taskType;
/**
* Конструктор простой фабрики задач
* @param supplier метод, возвращающий новую задачу экспорта
* @param taskType тип задачи
*/
public ExchangeSimpleTaskFactory(Supplier> supplier, Class extends ExchangeProcessorTask> taskType) {
this.supplier = supplier;
this.taskType = taskType;
}
@Override
public ExchangeProcessorTask create() {
return supplier.get();
}
@Override
public Class extends ExchangeProcessorTask> getType() {
return taskType;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy