X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcommon%2Futil%2FArguments.java;h=a4017c23a89df0b4099f193e6cef4f44c2f281f9;hp=902665d1a6fa137d41d7f1bc89cf8116fbb52ee1;hb=0b633bdba0370eefe432a9dbb29eb347f0506766;hpb=3b0f2c65bfb0f0b07e27529734561a7ae9ee5ad9 diff --git a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Arguments.java b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Arguments.java index 902665d1a6..a4017c23a8 100644 --- a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Arguments.java +++ b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Arguments.java @@ -7,16 +7,16 @@ */ package org.opendaylight.controller.sal.common.util; -public class Arguments { +public final class Arguments { private Arguments() { throw new UnsupportedOperationException("Utility class"); } - + /** * Checks if value is instance of provided class - * - * + * + * * @param value Value to check * @param type Type to check * @return Reference which was checked @@ -24,7 +24,7 @@ public class Arguments { @SuppressWarnings("unchecked") public static T checkInstanceOf(Object value, Class type) { if(!type.isInstance(value)) - throw new IllegalArgumentException(); + throw new IllegalArgumentException(String.format("Value %s is not of type %s", value, type)); return (T) value; } }