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

com.quorum.tessera.reflect.ReflectCallback Maven / Gradle / Ivy

There is a newer version: 0.11.0.30092019161842
Show newest version
package com.quorum.tessera.reflect;

import java.lang.reflect.InvocationTargetException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@FunctionalInterface
public interface ReflectCallback {
    
    Logger LOGGER = LoggerFactory.getLogger(ReflectCallback.class);
    
    T doExecute() throws ClassNotFoundException,
            NoSuchFieldException,
            IllegalArgumentException,
            IllegalAccessException,
            NoSuchMethodException,
            InvocationTargetException,
            InstantiationException;


    static  T execute(ReflectCallback callback) {
        try {
            return callback.doExecute();
        } catch (InstantiationException | NoSuchMethodException | InvocationTargetException
                | IllegalArgumentException | IllegalAccessException | NoSuchFieldException | ClassNotFoundException ex) {
            LOGGER.error(null, ex);
            throw new ReflectException(ex);
        }        
        
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy