X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcommon%2Futil%2FArguments.java;h=d09024aea0ccf73a50006c9c28bdca4e3b7a9aa1;hb=8da08c9f008d371c491cf6b35494ca36c2ebdcb9;hp=902665d1a6fa137d41d7f1bc89cf8116fbb52ee1;hpb=cbdf09d099f297db7712c3dd4637475c88f92113;p=controller.git 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..d09024aea0 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,24 +7,24 @@ */ 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 - * - * + * Checks if value is instance of provided class. + * * @param value Value to check * @param type Type to check * @return Reference which was checked */ @SuppressWarnings("unchecked") public static T checkInstanceOf(Object value, Class type) { - if(!type.isInstance(value)) - throw new IllegalArgumentException(); + if (!type.isInstance(value)) { + throw new IllegalArgumentException(String.format("Value %s is not of type %s", value, type)); + } return (T) value; } }