Cleaned up Java Binding code from YANG Tools
[mdsal.git] / code-generator / binding-data-codec / src / main / java / org / opendaylight / yangtools / binding / data / codec / impl / IncorrectNestingException.java
diff --git a/code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/IncorrectNestingException.java b/code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/IncorrectNestingException.java
deleted file mode 100644 (file)
index 5e7ec6a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.binding.data.codec.impl;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-/**
- *
- * Thrown where incorrect nesting of data structures was detected
- * and was caused by user.
- *
- */
-public class IncorrectNestingException extends IllegalArgumentException {
-
-    private static final long serialVersionUID = 1L;
-
-    protected IncorrectNestingException(final String message) {
-        super(message);
-    }
-
-    public static IncorrectNestingException create(final String message, final Object... args) {
-        return new IncorrectNestingException(String.format(message, args));
-    }
-
-    public static void check(final boolean check, final String message, final Object... args) {
-        if(!check) {
-            throw IncorrectNestingException.create(message, args);
-        }
-    }
-
-    @Nonnull
-    public static <V> V checkNonNull(@Nullable final V nullable, final String message, final Object... args) {
-        if(nullable != null) {
-            return nullable;
-        }
-        throw IncorrectNestingException.create(message, args);
-    }
-}