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

com.github.restup.bind.converter.ParameterConverter Maven / Gradle / Ivy

There is a newer version: 0.0.5
Show newest version
package com.github.restup.bind.converter;

import java.util.function.Function;
import com.github.restup.errors.Errors;

/**
 * Interface for converting a parameter from input type to the appropriate field type
 * 
 * @param  from type
 * @param  to type
 */
public interface ParameterConverter extends Function {

    /**
     * Convert a parameter, appending any errors to provided errors object
     *
     * @param parameterName name of the parameter
     * @param from value of the parameter requiring conversion
     * @param errors to append any conversion errors to
     * @return the resulting value
     */
    R convert(String parameterName, T from, Errors errors);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy