@SuppressWarnings("unchecked")
	public void addErrors(String field, List<String> errors) {
		Assert.notNull(field, "field must not be null");
		Assert.notNull(errors, "field must not be null");

		// do not overwrite existing errors
		Map<String, List<String>> errorMap = (Map<String, List<String>>) this.result
				.get(ERRORS_PROPERTY);
		if (errorMap == null) {
			errorMap = new HashMap<>();
			addResultProperty(ERRORS_PROPERTY, errorMap);
		}

		List<String> fieldErrors = errorMap.get(field);
		if (fieldErrors == null) {
			fieldErrors = new ArrayList<>();
			errorMap.put(field, fieldErrors);
		}
		fieldErrors.addAll(errors);

		addResultProperty(SUCCESS_PROPERTY, Boolean.FALSE);
	}
@ SuppressWarnings ( "unchecked" ) public void addErrors ( String field , List < String > errors ) { Assert . notNull ( field , "field must not be null" ) ; Assert . notNull ( errors , "field must not be null" ) ; Map < String , List < String > > errorMap = ( Map < String , List < String > > ) this . result . get ( ERRORS_PROPERTY ) ; if ( errorMap == null ) { errorMap = new HashMap < > ( ) ; addResultProperty ( ERRORS_PROPERTY , errorMap ) ; } List < String > fieldErrors = errorMap . get ( field ) ; if ( fieldErrors == null ) { fieldErrors = new ArrayList < > ( ) ; errorMap . put ( field , fieldErrors ) ; } fieldErrors . addAll ( errors ) ; addResultProperty ( SUCCESS_PROPERTY , Boolean . FALSE ) ; }
Adds multiple error messages to a specific field. Does not overwrite already
existing errors.

@param field the name of the field
@param errors a collection of error messages