<commit_before>package org.motechproject.adherence.contract;

import org.joda.time.LocalDate;
import org.motechproject.adherence.domain.AdherenceLog;

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

public class AdherenceRecords {

    String externalId;
    String treatmentId;
    List<AdherenceRecord> adherenceRecords;

    public AdherenceRecords(String externalId, String treatmentId, List<AdherenceLog> logs) {
        this.externalId = externalId;
        this.treatmentId = treatmentId;
        adherenceRecords(logs);
    }

    private void adherenceRecords(List<AdherenceLog> logs) {
        this.adherenceRecords = new ArrayList<AdherenceRecord>();
        for (AdherenceLog log : logs) {
            adherenceRecords.add(new AdherenceRecord(log.doseDate(), log.status(), log.meta()));
        }
    }

    public List<AdherenceRecord> adherenceRecords() {
        return adherenceRecords;
    }

    public int size() {
        return adherenceRecords.size();
    }

    public static class AdherenceRecord {

        LocalDate recordDate;
        int status;
        Map<String, Object> meta;

        public AdherenceRecord(LocalDate recordDate, int status, Map<String, Object> meta) {
            this.recordDate = recordDate;
            this.status = status;
            this.meta = meta;
        }

        public LocalDate recordDate() {
            return recordDate;
        }

        public int status() {
            return status;
        }

        public Map<String, Object> meta() {
            return meta;
        }

        public Object meta(String key) {
            return meta.get(key);
        }
    }
}
<commit_msg>Shruthi, BalajiN | #59 | Adding getters for treatmentId and externalId<commit_after>package org.motechproject.adherence.contract;

import org.joda.time.LocalDate;
import org.motechproject.adherence.domain.AdherenceLog;

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

public class AdherenceRecords {

    String externalId;
    String treatmentId;
    List<AdherenceRecord> adherenceRecords;

    public AdherenceRecords(String externalId, String treatmentId, List<AdherenceLog> logs) {
        this.externalId = externalId;
        this.treatmentId = treatmentId;
        adherenceRecords(logs);
    }

    private void adherenceRecords(List<AdherenceLog> logs) {
        this.adherenceRecords = new ArrayList<AdherenceRecord>();
        for (AdherenceLog log : logs) {
            adherenceRecords.add(new AdherenceRecord(log.doseDate(), log.status(), log.meta()));
        }
    }

    public List<AdherenceRecord> adherenceRecords() {
        return adherenceRecords;
    }

    public int size() {
        return adherenceRecords.size();
    }

    public String externalId() {
        return externalId;
    }

    public String treatmentId() {
        return treatmentId;
    }

    public static class AdherenceRecord {

        LocalDate recordDate;
        int status;
        Map<String, Object> meta;

        public AdherenceRecord(LocalDate recordDate, int status, Map<String, Object> meta) {
            this.recordDate = recordDate;
            this.status = status;
            this.meta = meta;
        }

        public LocalDate recordDate() {
            return recordDate;
        }

        public int status() {
            return status;
        }

        public Map<String, Object> meta() {
            return meta;
        }

        public Object meta(String key) {
            return meta.get(key);
        }
    }
}

{'fraction_non_alphanumeric': 0.08893892485223755, 'fraction_numerical': 0.0005629045876723895, 'mean_word_length': 2.3879885605338416, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3755931', 'n_tokens_mistral': 1030, 'n_tokens_neox': 936, 'n_words': 228}