6adf7456a6a0d73b779cae580c699ec5d1227aa3
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / leafref / LeafRefDataValidationFailedException.java
1 /**
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.data.impl.leafref;
9
10 public class LeafRefDataValidationFailedException extends Exception {
11
12     private static final long serialVersionUID = 1L;
13
14     private final int errorsCount;
15
16     public LeafRefDataValidationFailedException(final String message, final int errorsCount) {
17         super(message);
18         this.errorsCount = errorsCount;
19     }
20
21     public LeafRefDataValidationFailedException(final String message) {
22         this(message, 1);
23     }
24
25     public LeafRefDataValidationFailedException(final String message, final Throwable cause) {
26         super(message, cause);
27         errorsCount = 1;
28     }
29
30     public int getValidationsErrorsCount() {
31         return errorsCount;
32     }
33 }