<commit_before>package com.apwglobal.nice.domain;

import com.apwglobal.nice.util.UnixDate;

import java.util.Date;

public class Journal {

    private Journal(Builder builder) {
        rowId = builder.rowId;
        itemId = builder.itemId;
        changeType = builder.changeType;
        changeDate = builder.changeDate;
        currentPrice = builder.currentPrice;
    }

    private long rowId;
    private long itemId;
    private JournalType changeType;
    private Date changeDate;
    private double currentPrice;

    public long getRowId() {
        return rowId;
    }
    public long getItemId() {
        return itemId;
    }
    public JournalType getChangeType() {
        return changeType;
    }
    public Date getChangeDate() {
        return changeDate;
    }
    public double getCurrentPrice() {
        return currentPrice;
    }

    public static final class Builder {
        private long rowId;
        private long itemId;
        private JournalType changeType;
        private Date changeDate;
        private double currentPrice;

        public Builder() {
        }

        public Builder rowId(long rowId) {
            this.rowId = rowId;
            return this;
        }

        public Builder itemId(long itemId) {
            this.itemId = itemId;
            return this;
        }

        public Builder changeType(String changeType) {
            this.changeType = JournalType.VALUES.get(changeType);
            return this;
        }

        public Builder changeDate(long unitTimestamp) {
            this.changeDate = UnixDate.toDate(unitTimestamp);
            return this;
        }

        public Builder currentPrice(double currentPrice) {
            this.currentPrice = currentPrice;
            return this;
        }

        public Journal build() {
            return new Journal(this);
        }
    }

    @Override
    public String toString() {
        return "Journal{" +
                "rowId=" + rowId +
                ", itemId=" + itemId +
                ", changeType=" + changeType +
                ", changeDate=" + changeDate +
                ", currentPrice=" + currentPrice +
                '}';
    }

}<commit_msg>- currentPrice is optional<commit_after>package com.apwglobal.nice.domain;

import com.apwglobal.nice.util.UnixDate;

import java.util.Date;
import java.util.Optional;

public class Journal {

    private long rowId;
    private long itemId;
    private JournalType changeType;
    private Date changeDate;
    private Optional<Double> currentPrice;

    private Journal(Builder builder) {
        rowId = builder.rowId;
        itemId = builder.itemId;
        changeType = builder.changeType;
        changeDate = builder.changeDate;
        currentPrice = builder.currentPrice;
    }

    public long getRowId() {
        return rowId;
    }
    public long getItemId() {
        return itemId;
    }
    public JournalType getChangeType() {
        return changeType;
    }
    public Date getChangeDate() {
        return changeDate;
    }
    public Optional<Double> getCurrentPrice() {
        return currentPrice;
    }

    public static final class Builder {
        private long rowId;
        private long itemId;
        private JournalType changeType;
        private Date changeDate;
        private Optional<Double> currentPrice;

        public Builder() {
        }

        public Builder rowId(long rowId) {
            this.rowId = rowId;
            return this;
        }

        public Builder itemId(long itemId) {
            this.itemId = itemId;
            return this;
        }

        public Builder changeType(String changeType) {
            this.changeType = JournalType.VALUES.get(changeType);
            return this;
        }

        public Builder changeDate(long unitTimestamp) {
            this.changeDate = UnixDate.toDate(unitTimestamp);
            return this;
        }

        public Builder currentPrice(double currentPrice) {
            if (currentPrice == 0.0) {
                this.currentPrice = Optional.empty();
            } else {
                this.currentPrice = Optional.of(currentPrice);
            }
            return this;
        }

        public Journal build() {
            return new Journal(this);
        }
    }

    @Override
    public String toString() {
        return "Journal{" +
                "rowId=" + rowId +
                ", itemId=" + itemId +
                ", changeType=" + changeType +
                ", changeDate=" + changeDate +
                ", currentPrice=" + currentPrice +
                '}';
    }

}
{'fraction_non_alphanumeric': 0.08096990690625677, 'fraction_numerical': 0.00043299415457891317, 'mean_word_length': 1.7582089552238807, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '7152231', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1168, 'n_words': 303}