<commit_before>package jp.co.nohana.albums;

import android.database.Cursor;
import android.os.Environment;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore;

/**
 * Wrapper object of the bucket id that represents device album folder as identifiable.
 * @author KeithYokoma
 * @since 1.0.0
 * @version 1.0.0
 */
@SuppressWarnings("unused") // public APIs
public class BucketId implements Parcelable {
    public static final Creator<BucketId> CREATOR = new Creator<BucketId>() {
        @Override
        public BucketId createFromParcel(Parcel source) {
            return new BucketId(source);
        }

        @Override
        public BucketId[] newArray(int size) {
            return new BucketId[size];
        }
    };
    private final int mHash;

    /* package */ BucketId(int hash) {
        mHash = hash;
    }

    /* package */ BucketId(Parcel source) {
        mHash = source.readInt();
    }

    public static BucketId valueOf(String dirName) {
        String filePath = Environment.getExternalStorageDirectory().toString() + "/" + dirName;
        return new BucketId(AlbumUtils.getBucketIdHash(filePath));
    }

    /**
     * Create a bucket id object from a {@link android.database.Cursor}.
     * This method is not responsible for managing cursor resource.
     * If the {@link android.database.Cursor} does not have a column of {@link android.provider.MediaStore.Images.Media#BUCKET_ID},
     * this will return null.
     * @param cursor to obtain bucket id.
     * @return the bucket id object, null if bucket id column does not exist.
     */
    public static BucketId from(Cursor cursor) {
        int index = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID);
        if (index == -1) {
            return null;
        }
        int hash = cursor.getInt(index);
        return new BucketId(hash);
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof BucketId) {
            BucketId e = (BucketId) o;
            return e.mHash == mHash;
        }
        return super.equals(o);
    }

    @Override
    public int hashCode() {
        return mHash;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(mHash);
    }

    @Override
    public String toString() {
        return String.valueOf(mHash);
    }

    public int toInteger() {
        return mHash;
    }
}
<commit_msg>Declare bucket id entity as final<commit_after>package jp.co.nohana.albums;

import android.database.Cursor;
import android.os.Environment;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore;

/**
 * Wrapper object of the bucket id that represents device album folder as identifiable.
 * @author KeithYokoma
 * @since 1.0.0
 * @version 1.0.0
 */
@SuppressWarnings("unused") // public APIs
public final class BucketId implements Parcelable {
    public static final Creator<BucketId> CREATOR = new Creator<BucketId>() {
        @Override
        public BucketId createFromParcel(Parcel source) {
            return new BucketId(source);
        }

        @Override
        public BucketId[] newArray(int size) {
            return new BucketId[size];
        }
    };
    private final int mHash;

    /* package */ BucketId(int hash) {
        mHash = hash;
    }

    /* package */ BucketId(Parcel source) {
        mHash = source.readInt();
    }

    public static BucketId valueOf(String dirName) {
        String filePath = Environment.getExternalStorageDirectory().toString() + "/" + dirName;
        return new BucketId(AlbumUtils.getBucketIdHash(filePath));
    }

    /**
     * Create a bucket id object from a {@link android.database.Cursor}.
     * This method is not responsible for managing cursor resource.
     * If the {@link android.database.Cursor} does not have a column of {@link android.provider.MediaStore.Images.Media#BUCKET_ID},
     * this will return null.
     * @param cursor to obtain bucket id.
     * @return the bucket id object, null if bucket id column does not exist.
     */
    public static BucketId from(Cursor cursor) {
        int index = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID);
        if (index == -1) {
            return null;
        }
        int hash = cursor.getInt(index);
        return new BucketId(hash);
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof BucketId) {
            BucketId e = (BucketId) o;
            return e.mHash == mHash;
        }
        return super.equals(o);
    }

    @Override
    public int hashCode() {
        return mHash;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(mHash);
    }

    @Override
    public String toString() {
        return String.valueOf(mHash);
    }

    public int toInteger() {
        return mHash;
    }
}

{'fraction_non_alphanumeric': 0.09731012658227849, 'fraction_numerical': 0.0031645569620253164, 'mean_word_length': 2.3962390866353256, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2138356', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1443, 'n_words': 424}