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 public class Arguments {
13 throw new UnsupportedOperationException("Utility class");
17 * Checks if value is instance of provided class
20 * @param value Value to check
21 * @param type Type to check
22 * @return Reference which was checked
24 @SuppressWarnings("unchecked")
25 public static <T> T checkInstanceOf(Object value, Class<T> type) {
26 if(!type.isInstance(value))
27 throw new IllegalArgumentException();