ifs-web-service/ifs-web-core/src/main/java/org/innovateuk/ifs/controller/ErrorToObjectErrorConverterFactory.java
/**
     * Given a field error, map it to a target field name on the error holder.
     *
     * @param mappingFunction returning the non-empty target field name. If empty,
     *                        no {@link FieldError} will be added to the error holder.
     * @return converter function between {@link Error} and {@link FieldError}.
     */
Given a field error, map it to a target field name on the error holder.
@param mappingFunction returning the non-empty target field name. If empty,
no  FieldError will be added to the error holder.
@return converter function between  Error and  FieldError.
Given a field error map it to a target field name on the error holder . @param mappingFunction returning the non - empty target field name . If empty no FieldError will be added to the error holder . @return converter function between Error and FieldError .
public static ErrorToObjectErrorConverter mappingFieldErrorToField(Function<Error, String> mappingFunction) {
        return e -> {
            if (e.isFieldError()) {
                return mappingErrorToField(mappingFunction).apply(e);
            }
            return Optional.empty();
        };
    }
public static ErrorToObjectErrorConverter mappingFieldErrorToField ( Function < Error , String > mappingFunction ) { return e -> { if ( e . isFieldError ( ) ) { return mappingErrorToField ( mappingFunction ) . apply ( e ) ; } return Optional . empty ( ) ; } ; }
Given a field error, map it to a target field name on the error holder.
Given a field error map it to a target field name on the error holder .