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

net.tascalate.concurrent.decorators.PromiseCustomizer Maven / Gradle / Ivy

Go to download

Implementation of blocking (IO-Bound) cancellable java.util.concurrent.CompletionStage and related extensions to java.util.concurrent.ExecutorService-s

There is a newer version: 0.9.8
Show newest version
/**
 * Copyright 2015-2019 Valery Silaev (http://vsilaev.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.tascalate.concurrent.decorators;

import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executor;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;

public interface PromiseCustomizer {
    
    default Runnable wrapArgument(Runnable original, boolean async) {
        return original;
    }

    default  Function wrapArgument(Function original, boolean async, boolean isCompose) {
        return original;
    }
    
    default  Consumer wrapArgument(Consumer original, boolean async) {
        return original;
    }
    
    default  Supplier wrapArgument(Supplier original, boolean async) {
        return original;
    }
    
    default  BiFunction wrapArgument(BiFunction original, boolean async) {
        return original;
    }
    
    default  BiConsumer wrapArgument(BiConsumer original, boolean async) {
        return original;
    }
    
    default  CompletionStage wrapArgument(CompletionStage original, boolean async) {
        return original;
    }
    
    default Executor wrapArgument(Executor original) {
        return original;
    }
}