@@ -0,0 +1,2584 @@
+package seedu.address.logic.commands;%0A%0Aimport java.time.LocalDate;%0Aimport java.time.LocalDateTime;%0Aimport java.time.LocalTime;%0A%0Aimport seedu.address.commons.core.Messages;%0Aimport seedu.address.commons.exceptions.IllegalValueException;%0Aimport seedu.address.model.task.DeadlineTask;%0Aimport seedu.address.model.task.Name;%0A%0Apublic class EditDeadlineCommand extends Command %7B%0A%0A    public static final String COMMAND_WORD = %22edit-due%22;%0A%0A    public static final String MESSAGE_USAGE = COMMAND_WORD%0A            + %22: Edits the deadline identified by the index number used in the filtered deadline listing.%5Cn%22%0A            + %22Parameters: INDEX %5Bdd-NEW_DUE_DATE%5D %5Bdt-NEW_DUE_TIME%5D %5Bn-NEW_NAME%5D%22%0A            + %22Example: %22 + COMMAND_WORD + %22 1 dd-12/12/2017 dt-8pm%22;%0A%0A    public static final String MESSAGE_EDIT_TASK_SUCCESS = %22Deadline edited: %251$s%22;%0A%0A    private final int targetIndex;%0A%0A    private final Name newName;%0A%0A    private final LocalDate newDate;%0A%0A    private final LocalTime newTime;%0A%0A    public EditDeadlineCommand(int targetIndex, String newName, LocalDate newDate, LocalTime newTime) throws IllegalValueException %7B%0A        this.targetIndex = targetIndex;%0A        this.newName = newName != null ? new Name(newName) : null;%0A        this.newDate = newDate;%0A        this.newTime = newTime;%0A    %7D%0A%0A    public int getTargetIndex() %7B%0A        return targetIndex;%0A    %7D%0A%0A    public LocalDate getNewDate() %7B%0A        return newDate;%0A    %7D%0A%0A    public LocalTime getNewTime() %7B%0A        return newTime;%0A    %7D%0A%0A    @Override%0A    public CommandResult execute() %7B%0A        DeadlineTask oldDeadlineTask;%0A        try %7B%0A            oldDeadlineTask = model.getDeadlineTask(targetIndex - 1);%0A        %7D catch (IllegalValueException e) %7B%0A            indicateAttemptToExecuteIncorrectCommand();%0A            return new CommandResult(Messages.MESSAGE_INVALID_TASK_DISPLAYED_INDEX);%0A        %7D%0A%0A        DeadlineTask newDeadlineTask;%0A        newDeadlineTask = new DeadlineTask(%0A                newName != null ? newName : oldDeadlineTask.name,%0A                LocalDateTime.of(%0A                        newDate != null ? newDate : oldDeadlineTask.getDue().toLocalDate(),%0A                        newTime != null ? newTime : oldDeadlineTask.getDue().toLocalTime()%0A                )%0A        );%0A%0A        try %7B%0A            model.setDeadlineTask(targetIndex - 1, newDeadlineTask);%0A        %7D catch (IllegalValueException e) %7B%0A            throw new AssertionError(%22The target deadline cannot be missing%22, e);%0A        %7D%0A%0A        return new CommandResult(String.format(MESSAGE_EDIT_TASK_SUCCESS, newDeadlineTask));%0A    %7D%0A%0A%7D%0A

implement EditDeadlineCommand