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

template.ConsumerFunctionalInterface.ftl Maven / Gradle / Ivy

package org.tenio.interstellar.functions;

import java.util.Objects;
import java.io.Serializable;

@FunctionalInterface
public interface Consumer${size}<<#list 1..size as idx>P${idx}<#if idx_has_next>, > extends Serializable {
    void accept(<#list 1..size as idx>P${idx} p${idx}<#if idx_has_next>, );

    default Consumer${size}<<#list 1..size as idx>P${idx}<#if idx_has_next>, > andThen(Consumer${size}<<#list 1..size as idx>? super P${idx}<#if idx_has_next>, > after) {
        Objects.requireNonNull(after);

        return (<#list 1..size as idx>p${idx}<#if idx_has_next>, ) -> {
            accept(<#list 1..size as idx>p${idx}<#if idx_has_next>, );
            after.accept(<#list 1..size as idx>p${idx}<#if idx_has_next>, );
        };
    }

    default void invoke(Object[] args) {
        accept(<#list 1..size as idx>(P${idx}) args[${idx - 1}]<#if idx_has_next>, );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy