<commit_before>/*
 * Copyright 2017 <NAME> <<EMAIL>>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package one.p_f.testing.msagimport.data;

/**
 *
 * @author p-f
 */
public class MsagObject {

    private final TableSchema schema;

    private final String[] data;

    public MsagObject(TableSchema schema) {
        this.schema = schema;
        data = new String[schema.getFieldTypes().size()];
    }

    public TableSchema getSchema() {
        return schema;
    }

    public String getFieldData(int field) {
        if (field < 0 || field > data.length) {
            throw new IllegalArgumentException("Illegal field number:  "
                    + field);
        }
        return data[field];
    }

    public void setFieldData(String... fieldData) {
        if (fieldData.length != data.length) {
            throw new IllegalArgumentException("Wrong number of fields given");
        }
        System.arraycopy(fieldData, 0, data, 0, data.length);
    }

    public void setFieldData(int field, String newData) {
        if (field < 0 || field > data.length) {
            throw new IllegalArgumentException("Illegal field number:  "
                    + field);
        }
        data[field] = newData;
    }
}
<commit_msg>Add toString method to MsagObject<commit_after>/*
 * Copyright 2017 <NAME> <<EMAIL>>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package one.p_f.testing.msagimport.data;

import java.util.Arrays;

/**
 *
 * @author p-f
 */
public class MsagObject {

    private final TableSchema schema;

    private final String[] data;

    public MsagObject(TableSchema schema) {
        this.schema = schema;
        data = new String[schema.getFieldTypes().size()];
    }

    public TableSchema getSchema() {
        return schema;
    }

    public String getFieldData(int field) {
        if (field < 0 || field > data.length) {
            throw new IllegalArgumentException("Illegal field number:  "
                    + field);
        }
        return data[field];
    }

    public void setFieldData(String... fieldData) {
        if (fieldData.length != data.length) {
            throw new IllegalArgumentException("Wrong number of fields given");
        }
        System.arraycopy(fieldData, 0, data, 0, data.length);
    }

    public void setFieldData(int field, String newData) {
        if (field < 0 || field > data.length) {
            throw new IllegalArgumentException("Illegal field number:  "
                    + field);
        }
        data[field] = newData;
    }

    public String toString() {
        return Arrays.deepToString(data);
    }
}

{'fraction_non_alphanumeric': 0.09632272228320526, 'fraction_numerical': 0.006586169045005488, 'mean_word_length': 2.5081809432146294, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2368343', 'n_tokens_mistral': 992, 'n_tokens_neox': 957, 'n_words': 343}