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

io.atleon.core.AloFactory Maven / Gradle / Ivy

package io.atleon.core;

import java.util.function.Consumer;

/**
 * Factory for creating implementations of {@link Alo}
 *
 * @param 
 */
@FunctionalInterface
public interface AloFactory {

    /**
     * Add decoration to this factory by decorating the Alo's it produces using the provided
     * decorator.
     *
     * @param decorator The {@link AloDecorator} to apply to created Alo's
     * @return A new decorating AloFactory
     */
    default AloFactory withDecorator(AloDecorator decorator) {
        return (t, acknowledger, nacknowledger) -> decorator.decorate(create(t, acknowledger, nacknowledger));
    }

    Alo create(T t, Runnable acknowledger, Consumer nacknowledger);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy