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

com.g2forge.gearbox.browser.operation.IOperationWrapper Maven / Gradle / Ivy

package com.g2forge.gearbox.browser.operation;

import com.g2forge.alexandria.java.function.IRunnable;

public interface IOperationWrapper {
	public void post();

	public void pre();

	public default IOperationWrapper wrap(IOperationWrapper inner) {
		return new IOperationWrapper() {
			@Override
			public void post() {
				inner.post();
				IOperationWrapper.this.post();
			}

			@Override
			public void pre() {
				IOperationWrapper.this.pre();
				inner.pre();
			}
		};
	}

	public default IRunnable wrap(IRunnable runnable) {
		return runnable.wrap(this::pre, this::post);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy