@@ -0,0 +1,3740 @@
+/*%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 */%0A%0Apackage org.spine3.examples.todolist.c.aggregate.failures;%0A%0Aimport org.spine3.examples.todolist.AssignLabelToTaskFailed;%0Aimport org.spine3.examples.todolist.FailedTaskCommandDetails;%0Aimport org.spine3.examples.todolist.LabelId;%0Aimport org.spine3.examples.todolist.RemoveLabelFromTaskFailed;%0Aimport org.spine3.examples.todolist.TaskId;%0Aimport org.spine3.examples.todolist.c.aggregate.TaskLabelsPart;%0Aimport org.spine3.examples.todolist.c.failures.CannotAssignLabelToTask;%0Aimport org.spine3.examples.todolist.c.failures.CannotRemoveLabelFromTask;%0A%0A/**%0A * Utility class for working with %7B@link TaskLabelsPart%7D failures.%0A *%0A * @author Illia Shepilov%0A */%0Apublic class TaskLabelsPartFailures %7B%0A%0A    private TaskLabelsPartFailures() %7B%0A    %7D%0A%0A    /**%0A     * Constructs and throws the %7B@link CannotAssignLabelToTask%7D failure according to the passed parameters.%0A     *%0A     * @param taskId  the ID of the task%0A     * @param labelId the ID of the label%0A     * @throws CannotAssignLabelToTask the failure to throw%0A     */%0A    public static void throwCannotAssignLabelToTaskFailure(TaskId taskId, LabelId labelId)%0A            throws CannotAssignLabelToTask %7B%0A        final FailedTaskCommandDetails commandFailed =%0A                FailedTaskCommandDetails.newBuilder()%0A                                        .setTaskId(taskId)%0A                                        .build();%0A        final AssignLabelToTaskFailed assignLabelToTaskFailed =%0A                AssignLabelToTaskFailed.newBuilder()%0A                                       .setFailureDetails(commandFailed)%0A                                       .setLabelId(labelId)%0A                                       .build();%0A        throw new CannotAssignLabelToTask(assignLabelToTaskFailed);%0A    %7D%0A%0A    /**%0A     * Constructs and throws the %7B@link CannotRemoveLabelFromTask%7D failure according to the passed parameters.%0A     *%0A     * @param taskId the ID of the task%0A     * @throws CannotRemoveLabelFromTask the failure to throw%0A     */%0A    public static void throwCannotRemoveLabelFromTaskFailure(LabelId labelId, TaskId taskId)%0A            throws CannotRemoveLabelFromTask %7B%0A        final FailedTaskCommandDetails commandFailed =%0A                FailedTaskCommandDetails.newBuilder()%0A                                        .setTaskId(taskId)%0A                                        .build();%0A        final RemoveLabelFromTaskFailed removeLabelFromTaskFailed =%0A                RemoveLabelFromTaskFailed.newBuilder()%0A                                         .setLabelId(labelId)%0A                                         .setFailureDetails(commandFailed)%0A                                         .build();%0A        throw new CannotRemoveLabelFromTask(removeLabelFromTaskFailed);%0A    %7D%0A%7D%0A

Create `TaskLabelsPartFailures`.