All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sf.tools.reflect.ReflectionExtends Maven / Gradle / Ivy

The newest version!
package sf.tools.reflect;

import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class ReflectionExtends {
    /**
     * 获取泛型类型
     * @param f
     * @return
     */
    public static Type[] getParameterizedType(Field f) {
        Type type = f.getGenericType();
        if (type instanceof ParameterizedType) {
            return ((ParameterizedType) type).getActualTypeArguments();
        }
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy