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

com.g2forge.alexandria.java.function.IThrowFunction1 Maven / Gradle / Ivy

There is a newer version: 0.0.18
Show newest version
package com.g2forge.alexandria.java.function;

@FunctionalInterface
public interface IThrowFunction1 extends IFunction {
	public static  IThrowFunction1 create(IThrowFunction1 function) {
		return function;
	}

	public static  IThrowFunction1 identity() {
		return v -> v;
	}

	public O apply(I input) throws T;

	public default IFunction1 wrap(IFunction1 wrapper) {
		return i -> {
			try {
				return apply(i);
			} catch (Throwable throwable) {
				throw wrapper.apply(throwable);
			}
		};
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy