Java Class InstanceOf instanceOfAll(Object o, Class... clazzes)

Here you can find the source of instanceOfAll(Object o, Class... clazzes)

Description

instance Of All

License

Open Source License

Declaration

public static boolean instanceOfAll(Object o, Class<?>... clazzes) 

Method Source Code

//package com.java2s;
/**//from   w  w  w  .java 2  s.co  m
 * <copyright>
 * Copyright (c) 2010-2012 Henshin developers. 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
 * </copyright>
 */

public class Main {
    public static boolean instanceOfAll(Object o, Class<?>... clazzes) {
        for (Class<?> clazz : clazzes)
            if (!clazz.isInstance(o))
                return false;
        return true;
    }
}

Related

  1. instanceOf(Object o, Class... classes)
  2. instanceOf(Object obj, String className)
  3. instanceOf(Object obj, String className)
  4. instanceOf(Object obj, String name)
  5. instanceOf(Object object, Class clazz)
  6. instanceofByteArray(Object o)
  7. instanceOfs(Class[] classes, Object[] objs)