Java Reflection Interface Get getInterfaceNames(Class c)

Here you can find the source of getInterfaceNames(Class c)

Description

get Interface Names

License

Apache License

Declaration

public static String[] getInterfaceNames(Class<?> c) 

Method Source Code

//package com.java2s;
/* /*from w w w .  j  a  v a 2 s.  c  om*/
 * Copyright (C) 2013-2015 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License").
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * Create by ZollTy on 2013-9-11 (http://blog.zollty.com, zollty@163.com)
 */

import java.util.ArrayList;

import java.util.List;

public class Main {

    public static String[] getInterfaceNames(Class<?> c) {
        Class<?>[] interfaces = c.getInterfaces();
        List<String> names = new ArrayList<String>();
        for (Class<?> i : interfaces) {
            names.add(i.getName());
        }
        return names.toArray(new String[interfaces.length]);
    }
}

Related

  1. getDeclaredInterfaces(Class claz, Class... assignableClasses)
  2. getImplementedInterfaceParents(Class clazz, Set classesResult)
  3. getImplementedInterfaces(Class clazz)
  4. getImplementedInterfaces(Class cl)
  5. getInterfaceInstance(Class interfaceType)
  6. getInterfaces(Class clazz)
  7. getInterfaces(Class c)
  8. getInterfaces(Class clazz)
  9. getInterfaces(Class clazz)