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

io.redskap.swagger.brake.report.ReporterFactory Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package io.redskap.swagger.brake.report;

import java.util.Collection;

import io.redskap.swagger.brake.runner.Options;
import io.redskap.swagger.brake.runner.OutputFormat;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class ReporterFactory {
    private final StdOutReporter stdOutReporter;
    private final Collection reporters;

    public Reporter create(Options options) {
        OutputFormat outputFormat = options.getOutputFormat();
        return reporters.stream().filter(r -> r.canReport(outputFormat)).findAny().orElse(stdOutReporter);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy