<commit_before>package org.motechproject.model;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * Motech Scheduled Event data carrier class,
 * Instance of this class with event specific data will be send by Motech Scheduler when a scheduled event is fired
 *
 * User:Igor (<EMAIL>)
 * Date: 16/02/11
 * Time: 1:43 PM
 *
 */
public class MotechScheduledEvent {

    private String jobId;
    private String eventType;
    private HashMap<String, Object> parameters;

    /**
     * Constructor
     * @param jobId - ID of the scheduled job that generated this event.
     * @param eventType - event type: Pill Reminder, Appointment Reminder ...
     * @param parameters - a Map<String, Object> of additional parameters stored as job details
     */
    public MotechScheduledEvent(String jobId, String eventType, HashMap<String, Object> parameters) {
        this.jobId = jobId;
        this.eventType = eventType;
        this.parameters = parameters;
    }

    public String getJobId() {
        return jobId;
    }

    public String getEventType() {
        return eventType;
    }

    public Map<String, Object> getParameters() {<commit_msg>MOTECH-238 added input data validation<commit_after>package org.motechproject.model;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * Motech Scheduled Event data carrier class,
 * Instance of this class with event specific data will be send by Motech Scheduler when a scheduled event is fired
 *
 * This class is immutable
 *
 * User:Igor (<EMAIL>)
 * Date: 16/02/11
 * Time: 1:43 PM
 *
 */
public final class MotechScheduledEvent {

    public static final String EVENT_TYPE_KEY_NAME = "eventType";

    private String jobId;
    private String eventType;
    private HashMap<String, Object> parameters;

    /**
     * Constructor
     * @param jobId - ID of the scheduled job that generated this event.
     * @param eventType - event type: Pill Reminder, Appointment Reminder ...
     * @param parameters - a Map<String, Object> of additional parameters
     *
     * @throws IllegalArgumentException if given jobId or entityType is null
     */
    public MotechScheduledEvent(String jobId, String eventType, HashMap<String, Object> parameters) {

        if (jobId == null) {
            throw new IllegalArgumentException("jobId can not be null");
        }

        if (eventType == null) {
            throw new IllegalArgumentException("eventType can not be null");
        }

        this.jobId = jobId;
        this.eventType = eventType;
        this.parameters = parameters;
    }

    public String getJobId() {
        return jobId;
    }

    public String getEventType() {
        return eventType;
    }

    public Map<String, Object> getParameters() {
        if (parameters == null ) {
            return Collections.emptyMap();
        }
{'fraction_non_alphanumeric': 0.08602150537634409, 'fraction_numerical': 0.007284079084287201, 'mean_word_length': 2.850467289719626, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3754978', 'n_tokens_mistral': 817, 'n_tokens_neox': 777, 'n_words': 273}