package seedu.manager.model.task;

import seedu.manager.commons.exceptions.IllegalValueException;

/**
 * Represents a Task's desc in the task manager.
 * Guarantees: immutable; is valid as declared in {@link #isValid(String)}
 */
public class Desc extends TaskProperty {
    public static final String MESSAGE_DESC_CONSTRAINTS = "Task descriptions can contain any characters";
    public static final String DESC_VALIDATION_REGEX = ".+";
    private String value;
    
    /**
     * Validates given desc.
     *
     * @throws IllegalValueException if given desc string is invalid.
     */
    public Desc(String desc) throws IllegalValueException {
        super(desc, DESC_VALIDATION_REGEX, MESSAGE_DESC_CONSTRAINTS);
        value = desc;
    }


    @Override
    public String toString() {
        return value;
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof Desc // instanceof handles nulls
                && this.value.equals(((Desc) other).value)); // state check
    }
}

@@ -432,16 +432,21 @@
 = %22.+%22;%0A
+    %0A
     priv
@@ -459,24 +459,78 @@
 ring value;%0A
+    private static final int PRETTY_MAX_LENGTH = 50; %0A
     %0A    /**
@@ -876,16 +876,224 @@
 e;%0A    %7D
+%0A    %0A    @Override%0A    public String getPrettyValue() %7B%0A    %09if (value.length() %3E PRETTY_MAX_LENGTH) %7B%0A    %09%09return value.substring(0, PRETTY_MAX_LENGTH - 3) + %22...%22;%0A    %09%7D else %7B%0A%09%09%09return value;%0A%09%09%7D%0A    %7D
 %0A%0A    @O

Shorten length of long descriptions to 50 characters