<commit_before>package org.motechproject.scheduletracking.api.domain;


import org.joda.time.LocalDate;

public class MilestoneAlert {
    private String milestoneName;

    private LocalDate earliestDate;
    private LocalDate dueDate;
    private LocalDate lateDate;
    private LocalDate defaultmentDate;

    public static MilestoneAlert fromMilestone(Milestone milestone, LocalDate referenceDate){
        return new MilestoneAlert(milestone.getName(),
                getWindowEndDate(milestone, referenceDate, WindowName.earliest),
                getWindowEndDate(milestone, referenceDate, WindowName.due),
                getWindowEndDate(milestone, referenceDate, WindowName.late),
                getWindowEndDate(milestone, referenceDate, WindowName.max));
    }

    private static LocalDate getWindowEndDate(Milestone milestone, LocalDate referenceDate, WindowName windowName) {
        return referenceDate.plusDays(milestone.getMilestoneWindow(windowName).getEnd().inDays());
    }

    private MilestoneAlert() {
    }

    private MilestoneAlert(String milestoneName, LocalDate earliestDate, LocalDate dueDate, LocalDate lateDate, LocalDate defaultmentDate) {
        this.milestoneName = milestoneName;
        this.earliestDate = earliestDate;<commit_msg>Alex | #1204 | Fixed the mileStoneAlert as serializable.<commit_after>package org.motechproject.scheduletracking.api.domain;


import org.joda.time.LocalDate;

import java.io.Serializable;

public class MilestoneAlert implements Serializable {
    private String milestoneName;

    private LocalDate earliestDate;
    private LocalDate dueDate;
    private LocalDate lateDate;
    private LocalDate defaultmentDate;

    public static MilestoneAlert fromMilestone(Milestone milestone, LocalDate referenceDate){
        return new MilestoneAlert(milestone.getName(),
                getWindowEndDate(milestone, referenceDate, WindowName.earliest),
                getWindowEndDate(milestone, referenceDate, WindowName.due),
                getWindowEndDate(milestone, referenceDate, WindowName.late),
                getWindowEndDate(milestone, referenceDate, WindowName.max));
    }

    private static LocalDate getWindowEndDate(Milestone milestone, LocalDate referenceDate, WindowName windowName) {
        return referenceDate.plusDays(milestone.getMilestoneWindow(windowName).getEnd().inDays());
    }

    private MilestoneAlert() {
    }

    private MilestoneAlert(String milestoneName, LocalDate earliestDate, LocalDate dueDate, LocalDate lateDate, LocalDate defaultmentDate) {
        this.milestoneName = milestoneName;
        this.earliestDate = earliestDate;
{'fraction_non_alphanumeric': 0.06989044200982245, 'fraction_numerical': 0.001511144692104269, 'mean_word_length': 4.121856866537717, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5457475', 'n_tokens_mistral': 695, 'n_tokens_neox': 657, 'n_words': 153}