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

io.github.bhowell2.apilib.ApiParam Maven / Gradle / Ivy

The newest version!
package io.github.bhowell2.apilib;

/**
 *
 * @param  the input parameter type (usually the check will retrieve
 *             something from this parameter type)
 * @param  the return type
 * @author Blake Howell
 */
@FunctionalInterface
public interface ApiParam {

	/**
	 * Retrieves the parameter to be checked from the supplied Map and returns
	 * the result of the appropriate type. Some results will return only the
	 * name of the parameter (e.g., {@link ApiSingleParam}) and others will
	 * return multiple (e.g., {@link ApiMapParam}) names.
	 *
	 * Generally exceptions should not be thrown and should be handled (all ApiLib
	 * ApiParam implementations handle exceptions) - this helps with performance
	 * if your endpoint receives heavy traffic.
	 *
	 * @param params The map to retrieve this parameter from. For top-level/root/unnamed
	 *               {@link ApiMapParam}s this will not retrieve anything, but use the
	 *               supplied map itself.
	 * @return the result of the check operation
	 */
	Result check(In params);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy