@@ -0,0 +1,3167 @@
+/*%0A * Copyright 2017, TeamDev Ltd. All rights reserved.%0A *%0A * Redistribution and use in source and/or binary forms, with or without%0A * modification, must retain the above copyright notice and the following%0A * disclaimer.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR%0A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT%0A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,%0A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT%0A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,%0A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY%0A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0Apackage io.spine.validate;%0A%0Aimport com.google.common.base.Function;%0Aimport com.google.common.base.MoreObjects;%0Aimport com.google.common.base.MoreObjects.ToStringHelper;%0Aimport io.spine.string.Stringifiers;%0A%0Aimport javax.annotation.Nullable;%0Aimport java.util.List;%0A%0Aimport static com.google.common.base.Joiner.on;%0Aimport static com.google.common.base.Preconditions.checkNotNull;%0Aimport static com.google.common.collect.Iterables.transform;%0Aimport static java.util.Collections.unmodifiableList;%0A%0A/**%0A * An exception, thrown if a %7B@code Message%7D does not pass the validation.%0A *%0A * @author Illia Shepilov%0A * @author Alex Tymchenko%0A */%0Apublic class ValidationException extends RuntimeException %7B%0A%0A    private static final long serialVersionUID = 0L;%0A%0A    private static final Function%3CConstraintViolation, String%3E TO_STRING_FN = new ToStringFn();%0A%0A    /**%0A     * List of the constraint violations, that were found during the validation.%0A     */%0A    private final List%3CConstraintViolation%3E constraintViolations;%0A%0A    public ValidationException(List%3CConstraintViolation%3E constraintViolations) %7B%0A        super();%0A        this.constraintViolations = constraintViolations;%0A    %7D%0A%0A    public List%3CConstraintViolation%3E getConstraintViolations() %7B%0A        return unmodifiableList(constraintViolations);%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        final ToStringHelper helper = MoreObjects.toStringHelper(this);%0A%0A        final String violationContent = constraintViolations.isEmpty()%0A                ? %22%5B%5D%22%0A                : on(%22, %22).join(transform(constraintViolations, TO_STRING_FN));%0A%0A        return helper.add(%22constraintViolations%22, violationContent)%0A                     .toString();%0A    %7D%0A%0A    /**%0A     * A function, transforming a %7B@linkplain ConstraintViolation constraint violation%7D%0A     * into a %7B@code String%7D.%0A     */%0A    private static final class ToStringFn implements Function%3CConstraintViolation, String%3E %7B%0A        @Nullable%0A        @Override%0A        public String apply(@Nullable ConstraintViolation input) %7B%0A            checkNotNull(input);%0A            return Stringifiers.toString(%0A                    input);%0A        %7D%0A    %7D%0A%7D%0A

Introduce a new `ValidationException` to use instead of `ConstraintViolationThrowable` in future.