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

org.molgenis.pathways.service.RemoteFunction Maven / Gradle / Ivy

There is a newer version: 5.2.2
Show newest version
package org.molgenis.pathways.service;

import java.rmi.RemoteException;
import java.util.function.Function;

/**
 * {@link FunctionalInterface} for a {@link Function} that can throw a {@link RemoteException}. These will be caught and
 * rethrown as {@link RuntimeException}s.
 */
@FunctionalInterface
public interface RemoteFunction extends Function
{

	@Override
	default R apply(final T elem)
	{
		try
		{
			return applyThrows(elem);
		}
		catch (final RemoteException e)
		{
			throw new RuntimeException(e);
		}
	}

	R applyThrows(T elem) throws RemoteException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy