class ReflectionUtils {

    @Api(2.0)
    @NonNull
    public static <T> T build(@NonNull Constructor<T> constructor, @Nullable Object... data) {
        try {
            return constructor.newInstance(data);
        } catch (InstantiationException e) {
            throw new HaloReflectionException("It is not possible to create an instance of class " + constructor.getDeclaringClass().getCanonicalName() + ".", e);
        } catch (IllegalAccessException e) {
            throw new HaloReflectionException("The constructor is not accessible for class " + constructor.getDeclaringClass().getCanonicalName() + ".", e);
        } catch (InvocationTargetException e) {
            throw new HaloReflectionException("Exception thrown by invoked constructor for class " + constructor.getDeclaringClass().getCanonicalName() + ".", e);
        } catch (IllegalArgumentException e) {
            throw new HaloReflectionException("Exception thrown for invalid parameters in class " + constructor.getDeclaringClass().getCanonicalName() + ".", e);
        }
    }

    private  ReflectionUtils();

}