Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.lang.reflect.Method;

import java.util.Collection;

import java.util.List;

import java.util.Map;

public class Main {
    public static Method[] toMethodArray(List<Method> list) {
        if (isEmpty(list)) {
            return new Method[0];
        }
        Method[] array = new Method[list.size()];
        return list.toArray(array);
    }

    public static boolean isEmpty(Collection<?> c) {
        return c == null || c.isEmpty();
    }

    public static boolean isEmpty(Map<?, ?> map) {
        return map == null || map.isEmpty();
    }

    @SafeVarargs
    public static <T> boolean isEmpty(T... array) {
        return array == null || array.length == 0;
    }
}