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

com.yahoo.vespa.model.application.validation.RoutingValidator Maven / Gradle / Ivy

There is a newer version: 8.409.18
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.application.validation;

import com.yahoo.vespa.model.application.validation.Validation.Context;

import java.util.List;

/**
 * Validates routing
 */
public class RoutingValidator implements Validator {

    @Override
    public void validate(Context context) {
        List errors = context.model().getRouting().getErrors();
        if (!errors.isEmpty()) {
            StringBuilder msg = new StringBuilder();
            msg.append("The routing specification contains ").append(errors.size()).append(" error(s):\n");
            for (int i = 0, len = errors.size(); i < len; ++i) {
                msg.append(i + 1).append(". ").append(errors.get(i)).append("\n");
            }
            context.illegal(msg.toString());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy