2 * Copyright (c) 2018 Pantheon Technologies, 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.mdsal.binding.generator.impl;
10 import static java.util.Objects.requireNonNull;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
14 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
17 * Exception thrown from ModuleContext when it detects a Java namespace clash between generated classes. This can occur
18 * because we are mapping multiple YANG namespaces to a single Java class namespace.
21 * While handling this case via an exception (and related mechanics) is a bit slow, it works with minimal disturbance
22 * of existing logic. The situation should not be very common and hence it should provide an acceptable performance
25 * @author Robert Varga
28 final class RenameMappingException extends IllegalStateException {
29 private static final long serialVersionUID = 1L;
31 private final JavaTypeName name;
32 private final SchemaNode definition;
34 RenameMappingException(final JavaTypeName name, final SchemaNode definition) {
35 super("Remap " + name + " occupant " + definition);
36 this.name = requireNonNull(name);
37 this.definition = requireNonNull(definition);
40 JavaTypeName getName() {
44 SchemaNode getDefinition() {