package com.czx.springbootshiro.util;
import org.apache.commons.beanutils.BeanUtils;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
/**
* @Author czx
* @Date 2019-07-18 11:12
* @Description:
**/
public class MapUtil {
/**
* 使用BeanUtils工具类 将Map转为Bean
* jar包地址
* <dependency>
* <groupId>commons-io</groupId>
* <artifactId>commons-io</artifactId>
* <version>2.6</version>
* </dependency>
*
* @param classz
* @param map
* @param <T>
* @return
*/
public static <T> T toBean(Class<T> classz, Map map) {
T bean = null;
try {