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

eu.solven.cleanthat.code_provider.github.event.GithubCodeCleanerFactory Maven / Gradle / Ivy

package eu.solven.cleanthat.code_provider.github.event;

import java.util.List;
import java.util.Optional;

import com.fasterxml.jackson.databind.ObjectMapper;

import eu.solven.cleanthat.code_provider.github.refs.GithubRefCleaner;
import eu.solven.cleanthat.codeprovider.git.IGitRefCleaner;
import eu.solven.cleanthat.formatter.ICodeProviderFormatter;
import eu.solven.cleanthat.language.ILanguageLintFixerFactory;

/**
 * {@link ICodeCleanerFactory} specialized for GitHub
 * 
 * @author Benoit Lacelle
 *
 */
public class GithubCodeCleanerFactory implements ICodeCleanerFactory {
	final List objectMappers;
	final List factories;
	final ICodeProviderFormatter formatterProvider;

	public GithubCodeCleanerFactory(List objectMappers,
			List factories,
			ICodeProviderFormatter formatterProvider) {
		this.objectMappers = objectMappers;
		this.factories = factories;
		this.formatterProvider = formatterProvider;
	}

	@Override
	public Optional makeCleaner(Object somethingInteresting) {
		if (somethingInteresting instanceof GithubAndToken) {
			GithubRefCleaner refCleaner = new GithubRefCleaner(objectMappers,
					factories,
					formatterProvider,
					(GithubAndToken) somethingInteresting);
			return Optional.of(refCleaner);
		}
		return Optional.empty();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy