2 * Copyright (c) 2013 Cisco Systems, Inc. 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.controller.sal.common.util;
10 @Deprecated(forRemoval = true)
11 public final class Arguments {
13 throw new UnsupportedOperationException("Utility class");
17 * Checks if value is instance of provided class.
19 * @param value Value to check
20 * @param type Type to check
21 * @return Reference which was checked
22 * @deprecated This utility is not used in this project, please brew your own or
23 * use {@code Preconditions.checkArgument()}.
25 @Deprecated(forRemoval = true)
26 public static <T> T checkInstanceOf(final Object value, final Class<T> type) {
27 if (!type.isInstance(value)) {
28 throw new IllegalArgumentException(String.format("Value %s is not of type %s", value, type));
30 return type.cast(value);