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

zed.utils.Reflections Maven / Gradle / Ivy

There is a newer version: 0.0.20
Show newest version
package zed.utils;

import org.apache.commons.lang3.reflect.FieldUtils;

import java.lang.reflect.Array;

public final class Reflections {

    private Reflections() {
    }

    @SuppressWarnings("unchecked") // Array#newInstance return Object
    public static  Class classOfArrayOfClass(Class clazz) {
        return (Class) Array.newInstance(clazz, 0).getClass();
    }

    public static void writeField(Object object, String field, Object value) {
        try {
            FieldUtils.writeField(object, field, value, true);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy