org.fiolino.common.processing.sink.ThreadsafeModifyingSink 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 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);
}
}