<commit_before>package org.motechproject.nms.flw.domain;

import org.joda.time.DateTime;
import org.motechproject.mds.annotations.Entity;
import org.motechproject.mds.annotations.Field;
import org.motechproject.mds.annotations.InstanceLifecycleListeners;
import org.motechproject.mds.domain.MdsEntity;
import org.motechproject.nms.flw.domain.validation.ValidFrontLineWorker;
import org.motechproject.nms.region.domain.District;
import org.motechproject.nms.region.domain.FullLocation;
import org.motechproject.nms.region.domain.HealthBlock;
import org.motechproject.nms.region.domain.HealthFacility;
import org.motechproject.nms.region.domain.HealthSubFacility;
import org.motechproject.nms.region.domain.Language;
import org.motechproject.nms.region.domain.State;
import org.motechproject.nms.region.domain.Taluka;
import org.motechproject.nms.region.domain.Village;
import org.motechproject.nms.region.domain.validation.ValidFullLocation;
import org.motechproject.nms.tracking.annotation.TrackClass;
import org.motechproject.nms.tracking.annotation.TrackFields;

import javax.jdo.annotations.Column;
import javax.jdo.annotations.Index;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.Unique;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

@ValidFullLocation
@ValidFrontLineWorker
@Entity(tableName = "nms_front_line_workers")
@Index(name = "status_invalidationDate_composit_idx", members = { "status", "invalidationDate" })
@TrackClass
@TrackFields
@InstanceLifecycleListeners
public class FrontLineWorker extends MdsEntity implements FullLocation {

    @Field
    private String flwId;

    @Field
    private String mctsFlwId;

    @Field(required = true)
    @Unique
    @Min(value = 1000000000L, message = "contactNumber must be 10 digits")
    @Max(value = 9999999999L, message = "contactNumber must be 10 digits")
    @Column(length = 10)
    private Long contactNumber;

    @Field
    private String name;

    @Field
    private FrontLineWorkerStatus status;

    @Field
    private DateTime invalidationDate;

    @Field
    private Language language;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private State state;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private District district;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private Taluka taluka;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private Village village;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private HealthBlock healthBlock;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private HealthFacility healthFacility;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private HealthSubFacility healthSubFacility;

    public FrontLineWorker(Long contactNumber) {
        this.contactNumber = contactNumber;
    }

    public FrontLineWorker(String name, Long contactNumber) {
        this.name = name;
        this.contactNumber = contactNumber;
    }

    public String getFlwId() {
        return flwId;
    }

    public void setFlwId(String flwId) {
        this.flwId = flwId;
    }

    public String getMctsFlwId() {
        return mctsFlwId;
    }

    public void setMctsFlwId(String mctsFlwId) {
        this.mctsFlwId = mctsFlwId;
    }

    public Long getContactNumber() {
        return contactNumber;
    }

    public void setContactNumber(Long contactNumber) {
        this.contactNumber = contactNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public FrontLineWorkerStatus getStatus() {
        return status;
    }

    public void setStatus(FrontLineWorkerStatus status) {
        this.status = status;

        if (this.status == FrontLineWorkerStatus.INVALID) {
            setInvalidationDate(new DateTime());

            // From ticket: https://applab.atlassian.net/browse/NMS-236
            // there was a discussion on mail with <NAME> <<EMAIL>>
            // <NAME> <<EMAIL>, <NAME> <<EMAIL>>
            // <NAME> <<EMAIL>> with the agreement to null msisdn when an FLW is
            // moved to invalid.  This way if a user with the same number calls they will be handled as
            // anonymous.  The handling for this was unclear in the SRS
//            setContactNumber(null);
        } else {
            setInvalidationDate(null);
        }
    }

    public DateTime getInvalidationDate() {
        return invalidationDate;
    }

    public void setInvalidationDate(DateTime invalidationDate) {
        this.invalidationDate = invalidationDate;
    }

    public Language getLanguage() {
        return language;
    }

    public void setLanguage(Language language) {
        this.language = language;
    }

    @Override
    public State getState() {
        return state;
    }<commit_msg>PM f'ing D!!!!!!<commit_after>package org.motechproject.nms.flw.domain;

import org.joda.time.DateTime;
import org.motechproject.mds.annotations.Entity;
import org.motechproject.mds.annotations.Field;
import org.motechproject.mds.annotations.InstanceLifecycleListeners;
import org.motechproject.mds.domain.MdsEntity;
import org.motechproject.nms.flw.domain.validation.ValidFrontLineWorker;
import org.motechproject.nms.region.domain.District;
import org.motechproject.nms.region.domain.FullLocation;
import org.motechproject.nms.region.domain.HealthBlock;
import org.motechproject.nms.region.domain.HealthFacility;
import org.motechproject.nms.region.domain.HealthSubFacility;
import org.motechproject.nms.region.domain.Language;
import org.motechproject.nms.region.domain.State;
import org.motechproject.nms.region.domain.Taluka;
import org.motechproject.nms.region.domain.Village;
import org.motechproject.nms.region.domain.validation.ValidFullLocation;
import org.motechproject.nms.tracking.annotation.TrackClass;
import org.motechproject.nms.tracking.annotation.TrackFields;

import javax.jdo.annotations.Column;
import javax.jdo.annotations.Index;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.Unique;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

@ValidFullLocation
@ValidFrontLineWorker
@Entity(tableName = "nms_front_line_workers")
@Index(name = "status_invalidationDate_composit_idx", members = { "status", "invalidationDate" })
@TrackClass
@TrackFields
@InstanceLifecycleListeners
public class FrontLineWorker extends MdsEntity implements FullLocation {

    @Field
    private String flwId;

    @Field
    private String mctsFlwId;

    @Field(required = true)
    @Unique
    @Min(value = 1000000000L, message = "contactNumber must be 10 digits")
    @Max(value = 9999999999L, message = "contactNumber must be 10 digits")
    @Column(length = 10)
    private Long contactNumber;

    @Field
    private String name;

    @Field
    private FrontLineWorkerStatus status;

    @Field
    private DateTime invalidationDate;

    @Field
    private Language language;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private State state;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private District district;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private Taluka taluka;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private Village village;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private HealthBlock healthBlock;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private HealthFacility healthFacility;

    @Field
    @Persistent(defaultFetchGroup = "true")
    private HealthSubFacility healthSubFacility;

    public FrontLineWorker(Long contactNumber) {
        this.contactNumber = contactNumber;
    }

    public FrontLineWorker(String name, Long contactNumber) {
        this.name = name;
        this.contactNumber = contactNumber;
    }

    public String getFlwId() {
        return flwId;
    }

    public void setFlwId(String flwId) {
        this.flwId = flwId;
    }

    public String getMctsFlwId() {
        return mctsFlwId;
    }

    public void setMctsFlwId(String mctsFlwId) {
        this.mctsFlwId = mctsFlwId;
    }

    public Long getContactNumber() {
        return contactNumber;
    }

    public void setContactNumber(Long contactNumber) {
        this.contactNumber = contactNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public FrontLineWorkerStatus getStatus() {
        return status;
    }

    public void setStatus(FrontLineWorkerStatus status) {
        this.status = status;

        if (this.status == FrontLineWorkerStatus.INVALID) {
            setInvalidationDate(new DateTime());
        } else {
            setInvalidationDate(null);
        }
    }

    public DateTime getInvalidationDate() {
        return invalidationDate;
    }

    public void setInvalidationDate(DateTime invalidationDate) {
        this.invalidationDate = invalidationDate;
    }

    public Language getLanguage() {
        return language;
    }

    public void setLanguage(Language language) {
        this.language = language;
    }

    @Override
    public State getState() {
        return state;
    }
{'fraction_non_alphanumeric': 0.08888170652876536, 'fraction_numerical': 0.00592544710191769, 'mean_word_length': 3.374646559849199, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 14, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '3141802', 'n_tokens_mistral': 2852, 'n_tokens_neox': 2684, 'n_words': 585}