ar.com.kfgodel.primitons.api.repositories.FunctionReposity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of primitons Show documentation
Show all versions of primitons Show documentation
Java project that offers numerous primitive conversions as functions
The newest version!
package ar.com.kfgodel.primitons.api.repositories;
import ar.com.kfgodel.nary.api.optionals.Optional;
import java.util.function.Function;
/**
* This type represents a storage for primitive transformation functions (primitons)
*
* Date: 30/12/17 - 16:36
*/
public interface FunctionReposity {
/**
* Registers a transformation function for the given types. A previous function for the given types is replaced if present
* @param inputType The class indicating the type of function input
* @param outputType The class indicatung the function output
* @param primiton The transformation function
* @param Expected input type
* @param Expected output type
* @return This instance for method chaining
*/
FunctionReposity addConverterFrom(Class inputType, Class outputType, Function extends I, ? super O> primiton);
/**
* Returns a function that converts input of the given type to output of the expected type.
* If such a function is not present on this repo, an empty is returned
* @param inputType The class indicating the possible input type
* @param outputType The class indicating the expected output type
* @param Expected input type
* @param Exected output type
* @return The optional function if found
*/
Optional> getConverterFrom(Class inputType, Class outputType);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy