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

com.ideaaedi.commonds.exec.Executor Maven / Gradle / Ivy

The newest version!
package com.ideaaedi.commonds.exec;

import com.ideaaedi.commonds.function.NoArgConsumer;
import com.ideaaedi.commonds.function.NoArgFunction;

import java.util.function.Consumer;
import java.util.function.Function;

/**
 * 执行器
 *
 * @author JustryDeng 
 * @since 2022/5/12 14:45
 */
public interface Executor {
    
    /**
     * 执行逻辑
     *
     * @param function
     *            业务逻辑块
     * @param param
     *            参数
     *
     * @return 逻辑执行结果
     */
     R exec(Function function, P param);
    
    /**
     * 执行同步逻辑
     *
     * @param function
     *            业务逻辑块
     * @return 执行结果
     */
     R exec(NoArgFunction function);
    
    /**
     * 执行逻辑
     *
     * @param consumer
     *            业务逻辑块
     * @param param
     *            参数
     *
     */
    

void voidExec(Consumer

consumer, P param); /** * 执行逻辑 * * @param consumer * 业务逻辑块 */ void voidExec(NoArgConsumer consumer); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy