<commit_before>package seedu.manager.model.activity;

import seedu.manager.commons.exceptions.IllegalValueException;

/**
 * Represents an event activity in Remindaroo.
 * Guarantees: details are present and not null, field values are validated.
 */

public class EventActivity extends Activity {
    private AMDate dateTime;
    private AMDate endDateTime;

    /**
     * Default constructor, should not be called
     */
    public EventActivity(String name) throws IllegalValueException {
        super(name);
        throw new IllegalValueException("Event has no start and/or end date/time.");
    }
    
    /**
     * Constructor which gets start and end dateTime in natural English from user input
     */
    public EventActivity(String name, String newStartDateTime, String newEndDateTime) throws IllegalValueException {
        super(name);
        this.dateTime = new AMDate(newStartDateTime);
        this.endDateTime = new AMDate(newEndDateTime);
        if (this.dateTime.getTime() > this.endDateTime.getTime()) {
            throw new IllegalValueException("Event has already ended before it starts.");
        }
    }
    
    /**
     * Constructor which gets start and end dateTime in epoch format from XML file
     */
    public EventActivity(String name, Long newEpochStartDateTime, Long newEpochEndDateTime) {
        super(name);
        this.dateTime = new AMDate(newEpochStartDateTime);
        this.endDateTime = new AMDate(newEpochEndDateTime);
    }
    
    /**
     * Constructor which gets start and end dateTime in AMDate, used for testing
     */
    public EventActivity(String name, AMDate testDateTime, AMDate testEndDateTime) {
        super(name);
        this.dateTime = testDateTime;
        this.endDateTime = testEndDateTime;
    }
    
    public AMDate getDateTime() {
        return dateTime;
    }
    
    public AMDate getEndDateTime() {
        return endDateTime;
    }
    
    public void setDateTime(String newDateTime) {
        this.dateTime.setAMDate(newDateTime);
    }
    
    
    public void setEndDateTime(String newEndDateTime) {
        this.endDateTime.setAMDate(newEndDateTime);
    }
}
<commit_msg>Refactor EventActivity message to constant<commit_after>package seedu.manager.model.activity;

import seedu.manager.commons.exceptions.IllegalValueException;

/**
 * Represents an event activity in Remindaroo.
 * Guarantees: details are present and not null, field values are validated.
 */

public class EventActivity extends Activity {
    public static final String MESSAGE_DATE_CONSTRAINTS = "Event has already ended before it starts.";
    private AMDate dateTime;
    private AMDate endDateTime;

    /**
     * Default constructor, should not be called
     */
    public EventActivity(String name) throws IllegalValueException {
        super(name);
        throw new IllegalValueException("Event has no start and/or end date/time.");
    }
    
    /**
     * Constructor which gets start and end dateTime in natural English from user input
     */
    public EventActivity(String name, String newStartDateTime, String newEndDateTime) throws IllegalValueException {
        super(name);
        this.dateTime = new AMDate(newStartDateTime);
        this.endDateTime = new AMDate(newEndDateTime);
        if (this.dateTime.getTime() > this.endDateTime.getTime()) {
            throw new IllegalValueException(MESSAGE_DATE_CONSTRAINTS);
        }
    }
    
    /**
     * Constructor which gets start and end dateTime in epoch format from XML file
     */
    public EventActivity(String name, Long newEpochStartDateTime, Long newEpochEndDateTime) {
        super(name);
        this.dateTime = new AMDate(newEpochStartDateTime);
        this.endDateTime = new AMDate(newEpochEndDateTime);
    }
    
    /**
     * Constructor which gets start and end dateTime in AMDate, used for testing
     */
    public EventActivity(String name, AMDate testDateTime, AMDate testEndDateTime) {
        super(name);
        this.dateTime = testDateTime;
        this.endDateTime = testEndDateTime;
    }
    
    public AMDate getDateTime() {
        return dateTime;
    }
    
    public AMDate getEndDateTime() {
        return endDateTime;
    }
    
    public void setDateTime(String newDateTime) {
        this.dateTime.setAMDate(newDateTime);
    }
    
    
    public void setEndDateTime(String newEndDateTime) {
        this.endDateTime.setAMDate(newEndDateTime);
    }
}

{'fraction_non_alphanumeric': 0.07604049493813274, 'fraction_numerical': 0.0, 'mean_word_length': 2.859375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5661924', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1167, 'n_words': 340}