dcutils.Lambda Maven / Gradle / Ivy
package dcutils;
/**
* Implementations are passed into functions which require a response provided by the user.
* E.g.:
new Lambda<Double,Integer>() {
// Returns half of the integer value.
public Double apply(Integer param) throws IllegalArgumentException {
if(null != param) {
return param / 2d;
} else {
return new IllegalArgumentException("param cannot be null.");
}
}
}
* @author dca
*/
public interface Lambda {
/**
* Implementations take the parameter and return some return value.
* @param param The parameter.
* @return The return value.
* @throws IllegalArgumentException If param is null.
*/
public R apply(P param) throws IllegalArgumentException;
} // END interface Lambda
© 2015 - 2025 Weber Informatics LLC | Privacy Policy