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

org.fiolino.common.processing.sink.ThreadsafeModifyingSink Maven / Gradle / Ivy

Go to download

General structure to easily create dynamic logic via MethodHandles and others.

There is a newer version: 1.0.10
Show newest version
package org.fiolino.common.processing.sink;

import org.fiolino.common.container.Container;

/**
 * Created by kuli on 20.01.16.
 */
public abstract class ThreadsafeModifyingSink extends ThreadsafeChainedSink {

    protected ThreadsafeModifyingSink(ThreadsafeSink target) {
        super(target);
    }

    /**
     * Handles the individual element.
     */
    protected abstract void touch(T element, Container metadata) throws Exception;

    @Override
    public void accept(T value, Container metadata) throws Exception {
        touch(value, metadata);

        getTarget().accept(value, metadata);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy