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

org.fiolino.common.processing.sink.DecomposingSink 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 31.03.16.
 */
public class DecomposingSink> extends ChainedSink
        implements CloneableSink> {
    public DecomposingSink(Sink target) {
        super(target);
    }

    @Override
    public void accept(C values, Container metadata) throws Exception {
        for (O each : values) {
            getTarget().accept(each, metadata);
        }
    }

    @Override
    public DecomposingSink createClone() {
        return new DecomposingSink<>(targetForCloning());
    }

    @Override
    public void partialCommit(Container metadata) throws Exception {
        if (getTarget() instanceof CloneableSink) {
            ((CloneableSink) getTarget()).partialCommit(metadata);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy