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

com.lajospolya.spotifyapiwrapper.reflection.MethodWrapper Maven / Gradle / Ivy

Go to download

This project wraps the Spotify public API in order to allow users to intuitively use it

There is a newer version: 3.0.RELEASE
Show newest version
package com.lajospolya.spotifyapiwrapper.reflection;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @author Lajos Polya
 *
 * This wraps java.lang.reflect.Method to allow for easier unit testing since
 * java.lang.reflect.Method is a final class it cannot be mocked
 */
public class MethodWrapper
{
    private Method method;

    public MethodWrapper(Method method)
    {
        this.method = method;
    }

    public void setAccessible(Boolean accessible)
    {
        this.method.setAccessible(accessible);
    }

    public Object invoke(Object invokeOn, Object... arg) throws InvocationTargetException, IllegalAccessException
    {
        return method.invoke(invokeOn, arg);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy