<commit_before>package com.brajagopal.rmend.app.beans;

import com.brajagopal.rmend.utils.SerDeUtils;
import com.google.common.base.Strings;
import com.google.gson.*;
import org.joda.time.DateTime;

import java.lang.reflect.Type;

/**
 * @author <bxr4261>
 */
public class UserViewBean {

    public static final String COMPOSITE_KEY_SEPARATOR = ":";

    private String uuid;
    private Long uid;
    private Long docNum;
    private DateTime updateTS;

    private Boolean isInvalid = false;

    private UserViewBean(Long _uid, Long _docNum) {
        if (_uid == 0 || _docNum == 0) {
            this.isInvalid = true;
        }
        this.uid = _uid;
        this.docNum = _docNum;
        updateTS = DateTime.now();
    }

    private UserViewBean(String _uuid, Long _docNum) {
        if (_docNum == 0 || Strings.isNullOrEmpty(_uuid)) {
            this.isInvalid = true;
        }
        this.uuid = _uuid;
        this.docNum = _docNum;
        updateTS = DateTime.now();
    }

    private UserViewBean(String _uuid, Long _uid, Long _docNum) {
        if (Strings.isNullOrEmpty(_uuid) && _uid == 0) {
            this.isInvalid = true;
        }
        if (_docNum == 0) {
            this.isInvalid = true;
        }
        this.uuid = _uuid;
        this.uid = _uid;
        this.docNum = _docNum;
        updateTS = DateTime.now();
    }

    public static UserViewBean create(Long uid, Long docNumber) {
        return new UserViewBean(uid, docNumber);
    }

    public static UserViewBean create(String uuid, Long docNumber) {
        return new UserViewBean(uuid, docNumber);
    }

    @Override
    public String toString() {
        return "UserViewBean{" +
                "uid=" + uid +
                ", uuid=" + uuid +
                ", docNum=" + docNum +
                ", updateTS=" + updateTS +
                '}';
    }

    public Long getUid() {
        return uid;
    }

    public Long getDocNum() {
        return docNum;
    }

    public DateTime getUpdateTS() {
        return updateTS;
    }

    public String getUuid() {
        return uuid;
    }

    public Boolean getIsInvalid() {
        return isInvalid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public void setDocNum(Long docNum) {
        this.docNum = docNum;
    }

    public static class UserViewBeanSerDe implements JsonSerializer<UserViewBean>, JsonDeserializer<UserViewBean> {

        @Override
        public JsonElement serialize(
                UserViewBean userViewBean,
                Type type,
                JsonSerializationContext jsonSerializationContext) {

            JsonObject root = new JsonObject();
            root.addProperty("uuid", userViewBean.getUuid());
            root.addProperty("uid", userViewBean.getUid());
            root.addProperty("docNum", userViewBean.getDocNum());
            root.addProperty("updateTS", userViewBean.getUpdateTS().toString("YYYY-MM-dd HH:mm:ss"));
            return root;
        }

        @Override
        public UserViewBean deserialize(
                JsonElement jsonElement,
                Type type,
                JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {

            final JsonObject root = jsonElement.getAsJsonObject();
            final String uuid = SerDeUtils.getValue(root, "uuid", "");
            final Long uid = SerDeUtils.getValue(root, "uid", 0l);
            final Long docNum = SerDeUtils.getValue(root, "docNum", 0l);

            UserViewBean retVal = new UserViewBean(uuid, uid, docNum);
            return new UserViewBean(uuid, uid, docNum);
        }
    }

    public String getCompositeKey() {
        return uid + COMPOSITE_KEY_SEPARATOR + docNum;
    }
}
<commit_msg>Adding the RecType attribute to the UserViewBean<commit_after>package com.brajagopal.rmend.app.beans;

import com.brajagopal.rmend.utils.SerDeUtils;
import com.google.common.base.Strings;
import com.google.gson.*;
import org.joda.time.DateTime;

import java.lang.reflect.Type;

/**
 * @author <bxr4261>
 */
public class UserViewBean {

    public static final String COMPOSITE_KEY_SEPARATOR = ":";

    private String uuid;
    private Long uid;
    private Long docNum;
    private DateTime updateTS;

    private String recType = "UNKNOWN";

    private Boolean isInvalid = false;

    private UserViewBean(Long _uid, Long _docNum) {
        if (_uid == 0 || _docNum == 0) {
            this.isInvalid = true;
        }
        this.uid = _uid;
        this.docNum = _docNum;
        updateTS = DateTime.now();
    }

    private UserViewBean(String _uuid, Long _docNum) {
        if (_docNum == 0 || Strings.isNullOrEmpty(_uuid)) {
            this.isInvalid = true;
        }
        this.uuid = _uuid;
        this.docNum = _docNum;
        updateTS = DateTime.now();
    }

    private UserViewBean(String _uuid, Long _uid, Long _docNum, String _recType) {
        if (Strings.isNullOrEmpty(_uuid) && _uid == 0) {
            this.isInvalid = true;
        }
        if (_docNum == 0) {
            this.isInvalid = true;
        }
        this.uuid = _uuid;
        this.uid = _uid;
        this.docNum = _docNum;
        updateTS = DateTime.now();
        this.recType = recType;
    }

    public static UserViewBean create(Long uid, Long docNumber) {
        return new UserViewBean(uid, docNumber);
    }

    public static UserViewBean create(String uuid, Long docNumber) {
        return new UserViewBean(uuid, docNumber);
    }

    @Override
    public String toString() {
        return "UserViewBean{" +
                "uuid='" + uuid + '\'' +
                ", uid=" + uid +
                ", docNum=" + docNum +
                ", updateTS=" + updateTS +
                ", recType='" + recType + '\'' +
                ", isInvalid=" + isInvalid +
                '}';
    }

    public Long getUid() {
        return uid;
    }

    public Long getDocNum() {
        return docNum;
    }

    public DateTime getUpdateTS() {
        return updateTS;
    }

    public String getUuid() {
        return uuid;
    }

    public Boolean getIsInvalid() {
        return isInvalid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public void setDocNum(Long docNum) {
        this.docNum = docNum;
    }

    public String getRecType() {
        return recType;
    }

    public void setRecType(String recType) {
        this.recType = recType;
    }

    public static class UserViewBeanSerDe implements JsonSerializer<UserViewBean>, JsonDeserializer<UserViewBean> {

        @Override
        public JsonElement serialize(
                UserViewBean userViewBean,
                Type type,
                JsonSerializationContext jsonSerializationContext) {

            JsonObject root = new JsonObject();
            root.addProperty("uuid", userViewBean.getUuid());
            root.addProperty("uid", userViewBean.getUid());
            root.addProperty("docNum", userViewBean.getDocNum());
            root.addProperty("updateTS", userViewBean.getUpdateTS().toString("YYYY-MM-dd HH:mm:ss"));
            return root;
        }

        @Override
        public UserViewBean deserialize(
                JsonElement jsonElement,
                Type type,
                JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {

            final JsonObject root = jsonElement.getAsJsonObject();
            final String uuid = SerDeUtils.getValue(root, "uuid", "");
            final Long uid = SerDeUtils.getValue(root, "uid", 0l);
            final Long docNum = SerDeUtils.getValue(root, "docNum", 0l);
            final String recType = SerDeUtils.getValue(root, "recType", "UNKNOWN");

            return new UserViewBean(uuid, uid, docNum, recType);
        }
    }

    public String getCompositeKey() {
        return uid + COMPOSITE_KEY_SEPARATOR + docNum;
    }
}

{'fraction_non_alphanumeric': 0.10090492128424446, 'fraction_numerical': 0.0027271600347093094, 'mean_word_length': 2.0468277945619335, 'pattern_counts': {'":': 2, '<': 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': '2651930', 'n_tokens_mistral': 2378, 'n_tokens_neox': 2300, 'n_words': 552}