2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.tree.impl;
10 import java.util.List;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
12 import org.opendaylight.yangtools.yang.data.api.YangNetconfError;
13 import org.opendaylight.yangtools.yang.data.api.YangNetconfErrorAware;
14 import org.opendaylight.yangtools.yang.data.tree.api.RequiredElementCountException;
17 * Exception thrown when unique constraints would be violated and we cannot throw a
18 * {@link RequiredElementCountException}.
20 final class MinMaxElementsValidationFailedException extends SchemaValidationFailedException
21 implements YangNetconfErrorAware {
22 private static final long serialVersionUID = 1L;
24 private final int min;
25 private final int max;
26 private final int actual;
28 // FIXME: 8.0.0: we do not have a path here. Should we just allow DataValidationFailedException whereever our call
30 MinMaxElementsValidationFailedException(final String message, final int min, final int max, final int actual) {
38 public List<YangNetconfError> getNetconfErrors() {
39 return new RequiredElementCountException(YangInstanceIdentifier.empty(), actual, min, max, "dummy")