@@ -0,0 +1,1982 @@
+package seedu.address.logic.parser;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.Optional;%0Aimport java.util.stream.Collectors;%0A%0Aimport seedu.address.commons.util.SubstringRange;%0A%0Apublic class ParseExceptionBuilder %7B%0A%0A    private StringBuilder message = new StringBuilder();%0A    private Throwable cause;%0A    private ArrayList%3CSubstringRange%3E ranges = new ArrayList%3C%3E();%0A%0A    public ParseExceptionBuilder(String message) %7B%0A        assert message != null;%0A        this.message.append(message);%0A    %7D%0A%0A    public ParseExceptionBuilder(Throwable cause) %7B%0A        this.message.append(cause.getMessage());%0A        this.cause = cause;%0A    %7D%0A%0A    public ParseExceptionBuilder(ParseException cause) %7B%0A        this((Throwable)cause);%0A        this.ranges.addAll(cause.getRanges());%0A    %7D%0A%0A    public ParseExceptionBuilder prependMessage(String message) %7B%0A        this.message.insert(0, message);%0A        return this;%0A    %7D%0A%0A    public ParseExceptionBuilder appendMessage(String message) %7B%0A        this.message.append(message);%0A        return this;%0A    %7D%0A%0A    public ParseExceptionBuilder addRange(SubstringRange range) %7B%0A        ranges.add(range);%0A        return this;%0A    %7D%0A%0A    public ParseExceptionBuilder addRangeOptional(Optional%3CSubstringRange%3E range) %7B%0A        if (range.isPresent()) %7B%0A            addRange(range.get());%0A        %7D%0A        return this;%0A    %7D%0A%0A    public ParseExceptionBuilder addRanges(Collection%3CSubstringRange%3E ranges) %7B%0A        this.ranges.addAll(ranges);%0A        return this;%0A    %7D%0A%0A    public ParseExceptionBuilder indentRanges(int x) %7B%0A        ranges = ranges.stream()%0A                    .map(range -%3E range.indent(x))%0A                    .collect(Collectors.toCollection(ArrayList::new));%0A        return this;%0A    %7D%0A%0A    public ParseExceptionBuilder clearRanges() %7B%0A        ranges.clear();%0A        return this;%0A    %7D%0A%0A    public ParseException build() %7B%0A        return new ParseException(message.toString(), cause, ranges);%0A    %7D%0A%0A%7D%0A

add ParseExceptionBuilder