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

graphql.schema.validation.SchemaValidationErrorCollector Maven / Gradle / Ivy

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

import graphql.Internal;

import java.util.LinkedHashSet;
import java.util.Set;

@Internal
public class SchemaValidationErrorCollector {

    private final LinkedHashSet errors = new LinkedHashSet<>();

    public void addError(SchemaValidationError validationError) {
        this.errors.add(validationError);
    }

    public Set getErrors() {
        return errors;
    }

    public boolean containsValidationError(SchemaValidationErrorType validationErrorType) {
        for (SchemaValidationError validationError : errors) {
            if (validationError.getClassification() == validationErrorType) return true;
        }
        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy