com.github.raduciumag.shapeshift.service.TransformationGeneratorService Maven / Gradle / Ivy
package com.github.raduciumag.shapeshift.service;
import com.github.raduciumag.shapeshift.model.transformation.generator.TransformationGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class TransformationGeneratorService {
private final List transformationGenerators;
@Autowired
public TransformationGeneratorService(final List transformationGenerators) {
this.transformationGenerators = transformationGenerators;
}
public Optional getGenerator(final String generatorName) {
return transformationGenerators.stream()
.filter(filter -> filter.getName().equals(generatorName))
.findFirst();
}
}