com.bluecatcode.common.functions.Function Maven / Gradle / Ivy
The newest version!
package com.bluecatcode.common.functions;
import javax.annotation.Nullable;
/**
* Determines an output value based on an input value.
*
* @since 1.1.0
*/
public interface Function extends CheckedFunction {
/**
* Returns the result of applying this function to {@code input}. This method is generally
* expected, but not absolutely required, to have the following properties:
*
*
* - Its execution does not cause any observable side effects.
*
- The computation is consistent with equals
*
*
* @throws NullPointerException if {@code input} is null and this function does not accept null arguments
* @throws RuntimeException if unable to compute
*/
@Nullable
T apply(@Nullable F input) throws RuntimeException;
}