995418824e8fafb8bc074eef8648d220a20c8bf2
[mdsal.git] / binding / mdsal-binding-dom-codec-api / src / main / java / org / opendaylight / mdsal / binding / dom / codec / api / IncorrectNestingException.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.mdsal.binding.dom.codec.api;
9
10 import com.google.common.annotations.Beta;
11 import java.io.Serial;
12
13 /**
14  * Thrown where incorrect nesting of data structures was detected and was caused by user. This typically indicates
15  * that class structure encountered could not have possibly been constructed according to the rules understood by the
16  * codec.
17  */
18 @Beta
19 public class IncorrectNestingException extends IllegalArgumentException {
20     @Serial
21     private static final long serialVersionUID = 1L;
22
23     public IncorrectNestingException(final String message) {
24         super(message);
25     }
26
27     public static IncorrectNestingException create(final String message, final Object... args) {
28         return new IncorrectNestingException(String.format(message, args));
29     }
30 }