<commit_before>package org.motechproject.server.messagecampaign.contract;

import org.joda.time.LocalDate;
import org.motechproject.model.DayOfWeek;
import org.motechproject.model.Time;

import java.util.ArrayList;
import java.util.List;

public class CampaignRequest {
    private String externalId;
    private String campaignName;
    private Time reminderTime;
    private LocalDate referenceDate;
    private Integer startOffset;
    private List<DayOfWeek> userPreferredDays;

    public CampaignRequest() {
    }

    public CampaignRequest(String externalId, String campaignName, Time reminderTime, LocalDate referenceDate) {
        this.externalId = externalId;
        this.campaignName = campaignName;
        this.reminderTime = reminderTime;
        this.referenceDate = referenceDate;
        userPreferredDays = new ArrayList<DayOfWeek>();
    }

    public CampaignRequest(String externalId, String campaignName, Time reminderTime, LocalDate referenceDate, Integer startOffset) {
        this(externalId, campaignName, reminderTime, referenceDate);
        this.startOffset = startOffset;
    }

    public CampaignRequest(String externalId, String campaignName, Time reminderTime, LocalDate referenceDate, List<DayOfWeek> userPreferredDays) {
        this(externalId, campaignName, reminderTime, referenceDate);
        this.userPreferredDays.addAll(userPreferredDays);
    }

    public void setCampaignName(String campaignName) {
        this.campaignName = campaignName;
    }

    public void setExternalId(String externalId) {
        this.externalId = externalId;
    }

    public String campaignName() {
        return this.campaignName;
    }

    public String externalId() {
        return this.externalId;
    }<commit_msg>manohar| #1516| adding java docs for CampaignRequest<commit_after>package org.motechproject.server.messagecampaign.contract;

import org.joda.time.LocalDate;
import org.motechproject.model.DayOfWeek;
import org.motechproject.model.Time;

import java.util.ArrayList;
import java.util.List;

/**
 * \ingroup MessageCampaign
 *
 * This is the document to enroll an entity into a campaign
 */
public class CampaignRequest {
    private String externalId;
    private String campaignName;
    private Time reminderTime;
    private LocalDate referenceDate;
    private Integer startOffset;
    private List<DayOfWeek> userPreferredDays;

    public CampaignRequest() {
    }

    /**
     * Creates a request for enrollment into a campaign. Holds all fields required for the enrollment.
     * @param externalId - a client defined id to identify the enrollment
     * @param campaignName - the campaign into which the entity should be enrolled
     * @param reminderTime - time of day at which the alert must be raised. can be overridden by campaign's deliverTime, unless 24.hour.repeating.campaign.strategy is true
     * @param referenceDate - the date the campaign has started for this enrollment. it can be in the past resulting in a delayed enrollment.
     */
    public CampaignRequest(String externalId, String campaignName, Time reminderTime, LocalDate referenceDate) {
        this.externalId = externalId;
        this.campaignName = campaignName;
        this.reminderTime = reminderTime;
        this.referenceDate = referenceDate;
        userPreferredDays = new ArrayList<DayOfWeek>();
    }

    /**
     * Creates a request for enrollment into a campaign. Holds all fields required for the enrollment.
     * @param externalId - a client defined id to identify the enrollment
     * @param campaignName - the campaign into which the entity should be enrolled
     * @param reminderTime - time of day at which the alert must be raised. can be overridden by campaign's deliverTime, unless 24.hour.repeating.campaign.strategy is true
     * @param referenceDate - the date the campaign has started for this enrollment. it can be in the past resulting in a delayed enrollment.
     * @param startOffset - the offset should be used in case of a delayed enrollment to specify where the enrollment begins w.r.t the referenceDate.
     */
    public CampaignRequest(String externalId, String campaignName, Time reminderTime, LocalDate referenceDate, Integer startOffset) {
        this(externalId, campaignName, reminderTime, referenceDate);
        this.startOffset = startOffset;
    }

    /**
     * Creates a request for enrollment into a campaign. Holds all fields required for the enrollment.
     * @param externalId - a client defined id to identify the enrollment
     * @param campaignName - the campaign into which the entity should be enrolled
     * @param reminderTime - time of day at which the alert must be raised. can be overridden by campaign's deliverTime, unless 24.hour.repeating.campaign.strategy is true
     * @param referenceDate - the date the campaign has started for this enrollment. it can be in the past resulting in a delayed enrollment.
     * @param userPreferredDays - specify a list of days that override the days defined by the campaign. The enrollment will have alerts raised on these days only.
     */
    public CampaignRequest(String externalId, String campaignName, Time reminderTime, LocalDate referenceDate, List<DayOfWeek> userPreferredDays) {
        this(externalId, campaignName, reminderTime, referenceDate);
        this.userPreferredDays.addAll(userPreferredDays);
    }

    public void setCampaignName(String campaignName) {
        this.campaignName = campaignName;
    }

    public void setExternalId(String externalId) {
        this.externalId = externalId;
    }

    public String campaignName() {
        return this.campaignName;
    }

    public String externalId() {
        return this.externalId;
    }
{'fraction_non_alphanumeric': 0.06389664804469274, 'fraction_numerical': 0.0017458100558659217, 'mean_word_length': 3.5832, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7595677', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1404, 'n_words': 526}