org.fiolino.common.processing.sink.ModifyingSink Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons Show documentation
Show all versions of commons Show documentation
General structure to easily create dynamic logic via MethodHandles and others.
package org.fiolino.common.processing.sink;
import org.fiolino.common.container.Container;
/**
* Created by kuli on 20.01.16.
*/
public abstract class ModifyingSink extends ChainedSink {
protected ModifyingSink(Sink super T> target) {
super(target);
}
/**
* Handles the individual element.
*/
protected abstract void touch(T element, Container metadata) throws Exception;
@Override
public final void accept(T value, Container metadata) throws Exception {
touch(value, metadata);
getTarget().accept(value, metadata);
}
}