Composes human readable error message based on validation results.

@param results a list of validation results.
@return a composed error message.

@see ValidationResult
976561
public static String composeMessage(List<ValidationResult> results) {
		StringBuilder builder = new StringBuilder();
		builder.append("Validation failed");

		if (results != null && results.size() > 0) {
			boolean first = true;
			for (ValidationResult result : results) {
				if (result.getType() != ValidationResultType.Information) {
					if (!first)
						builder.append(": ");
					else
						builder.append(", ");
					builder.append(result.getMessage());
					first = false;
				}
			}
		}

		return builder.toString();
	}
349464
public void addErrorMsgs(final Set<String> msgs) {
    if (msgs != null) {
      this._errorMsgs.addAll(msgs);
      if (!msgs.isEmpty()) {
        this._status = ValidationStatus.ERROR;
      }
    }
  }
1146967
protected String determineDefaltMessage(final Map<String, Object> errorVars, ConstraintViolation<Object> violation) {
        
        String message = violation.getMessage();
        if(messageInterpolator == null) {
            return message;
            
        } else if(!(message.contains("{") && message.contains("}"))) {
            // 変数形式が含まれていない場合は、そのまま返す。
            return message;
        }
        
        MessageInterpolatorContext context = new MessageInterpolatorContext(
                violation.getConstraintDescriptor(),
                violation.getInvalidValue(),
                violation.getRootBeanClass(),
                errorVars,
                Collections.emptyMap());
        
        return messageInterpolator.interpolate(violation.getMessageTemplate(), context);
        
    }
964806
function (err, results) {
    err && console.error(err);

    results.forEach(function (result) {
        var failures = result.run.failures;

        console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
            `${result.collection.name} ran successfully.`);
    });
}
970728
public static void validateResults(Map<Integer, Object> results) {
        for (Object result : results.values()) {
            if (result != null && result instanceof CacheClearResponse) {
                Object response = ((CacheClearResponse) result).getResponse();
                if (response instanceof Throwable) {
                    ExceptionUtil.sneakyThrow((Throwable) response);
                }
            }
        }
    }
23425
public function removeNullableErrors(IValidationResult $result) {
        $nullableSubjects = $this->getNullableSubjects($result);
        $filteredResult = new ValidationResult();

        foreach ($result->getErrors() as $error) {
            if ( ! $this->shouldErrorBeIgnored($nullableSubjects, $error)) {
                $filteredResult->addError($error);
            }
        }

        return $filteredResult;
    }
454937
public void setValidationEmails(java.util.Collection<String> validationEmails) {
        if (validationEmails == null) {
            this.validationEmails = null;
            return;
        }

        this.validationEmails = new java.util.ArrayList<String>(validationEmails);
    }
486095
public function setSessionValidationResult(ValidationResult $result, $combineWithExisting = false)
    {
        // Combine with existing result
        if ($combineWithExisting) {
            $existingResult = $this->getSessionValidationResult();
            if ($existingResult) {
                if ($result) {
                    $existingResult->combineAnd($result);
                } else {
                    $result = $existingResult;
                }
            }
        }

        // Serialise
        $resultData = $result ? serialize($result) : null;
        $this->getSession()->set("FormInfo.{$this->FormName()}.result", $resultData);
        return $this;
    }
1169841
public void setValidationErrors(java.util.Collection<ValidationError> validationErrors) {
        if (validationErrors == null) {
            this.validationErrors = null;
            return;
        }

        this.validationErrors = new java.util.ArrayList<ValidationError>(validationErrors);
    }
320740
protected void handleImportResults(List<CmsAliasImportResult> results) {

        clearResults();
        for (CmsAliasImportResult singleResult : results) {
            addImportResult(singleResult);
        }
    }
867589
protected Throwable composeErrors(Throwable... errors) {

    if (errors == null) {
      return new NullPointerException("errors");
    } else if (errors.length == 1) {
      return errors[0];
    } else {
      return new ComposedException(errors);
    }
  }
1290745
protected function getAjaxErrorResponse(ValidationResult $result)
    {
        // Ajax form submissions accept json encoded errors by default
        $acceptType = $this->getRequest()->getHeader('Accept');
        if (strpos($acceptType, 'application/json') !== false) {
            // Send validation errors back as JSON with a flag at the start
            $response = new HTTPResponse(json_encode($result->getMessages()));
            $response->addHeader('Content-Type', 'application/json');
            return $response;
        }

        // Send the newly rendered form tag as HTML
        $this->form->loadMessagesFrom($result);
        $response = new HTTPResponse($this->form->forTemplate());
        $response->addHeader('Content-Type', 'text/html');
        return $response;
    }
1245563
public static <R> MethodResult<R> success(R result) {
        return new MethodResult<>(result, null, false);
    }
265171
public String buildResultsInfoMessage(FeatureIndexResults results, double tolerance, Projection projection) {
        return buildResultsInfoMessage(results, tolerance, null, projection);
    }
1008617
public void validate(String path, Schema schema, Object value, List<ValidationResult> results) {
		String name = path != null ? path : "value";
		boolean found = false;

		for (Object thisValue : _values) {
			if (thisValue != null && thisValue.equals(value)) {
				found = true;
				break;
			}
		}

		if (!found) {
			results.add(new ValidationResult(path, ValidationResultType.Error, "VALUE_NOT_INCLUDED",
					name + " must be one of " + _values, _values, value));
		}
	}
848192
public Result withSuccessMessages(String... successMessages) {
        List<String> msgList = Arrays.asList(successMessages);
        return withSuccessMessages(msgList);
    }
576399
public void validate(String path, Schema schema, Object value, List<ValidationResult> results) {
		String name = path != null ? path : "value";
		List<String> found = new ArrayList<String>();

		for (String property : _properties) {
			Object propertyValue = ObjectReader.getProperty(value, property);
			if (propertyValue != null)
				found.add(property);
		}

		if (found.size() == 0) {
			results.add(new ValidationResult(path, ValidationResultType.Error, "VALUE_NULL",
					name + " must have at least one property from " + _properties, _properties, null));
		}
	}