map转指定类型实体类map

用于转换成符合实体类属性的mappublic Map<String, Object> convertMapToBeanMap(Map<String, Object> params, Class clazz) throws IntrospectionException {    Map<String, Object> finalMap = new HashMap<>();    BeanInfo beanInfo = Introspector.getBeanInfo(clazz);    PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();    for (int i = 0; i < propertyDescriptors.length; i++) {        PropertyDescriptor descriptor = propertyDescriptors[i];        String propertyName = descriptor.getName();        if (!propertyName.equals("class")) {            if (params.containsKey(propertyName)) {                finalMap.put(propertyName, params.get(propertyName));            }        }    }    return finalMap;}