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

graphql.schema.diff.reporting.ChainedReporter Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
package graphql.schema.diff.reporting;

import graphql.PublicApi;
import graphql.schema.diff.DiffEvent;

import java.util.Arrays;
import java.util.List;

/**
 * A reporter that chains together one or more difference reporters
 */
@PublicApi
public class ChainedReporter implements DifferenceReporter {
    private final List reporters;

    public ChainedReporter(DifferenceReporter... reporters) {
        this(Arrays.asList(reporters));
    }

    public ChainedReporter(List reporters) {
        this.reporters = reporters;
    }

    @Override
    public void report(DiffEvent differenceEvent) {
        reporters.forEach(reporter -> reporter.report(differenceEvent));
    }

    @Override
    public void onEnd() {
        reporters.forEach(DifferenceReporter::onEnd);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy