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

com.commercetools.sunrise.common.reverserouter.ReflectionReverseCaller Maven / Gradle / Ivy

There is a newer version: 1.0.0-M10
Show newest version
package com.commercetools.sunrise.common.reverserouter;

import play.mvc.Call;

import java.lang.reflect.Method;
import java.util.concurrent.CompletionException;

public class ReflectionReverseCaller implements ReverseCaller {

    private final Method method;
    private final Object object;

    public ReflectionReverseCaller(final Method method, final Object object) {
        this.method = method;
        this.object = object;
    }

    @Override
    public Call call(final Object... args) {
        try {
            return (Call) method.invoke(object, args);
        } catch (Exception e) {
            throw new CompletionException(e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy