<commit_before>Hrisey [![Build Status](https://travis-ci.org/mg6maciej/hrisey.svg?branch=master)](https://travis-ci.org/mg6maciej/hrisey)
======

Boilerplate code suppressor tool for Android platform based on [Project Lombok](http://projectlombok.org/).

Usage
-----

Add Hrisey as a dependency:

```Groovy
dependencies {
    provided 'pl.mg6.hrisey:hrisey:0.1.1'
}
```

Install [Hrisey Plugin](http://plugins.jetbrains.com/plugin/7462) in IntelliJ IDEA or Android Studio.

And then just start using it:

```Java
@hrisey.Parcelable
class ParcelableClass implements android.os.Parcelable {

    String myString;
}
```

This will generate

```Java
class ParcelableClass implements android.os.Parcelable {

    public static final android.os.Parcelable.Creator<ParcelableClass> CREATOR = new CreatorImpl();

    String myString;

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(android.os.Parcel dest, int flags) {
        dest.writeString(this.myString);
    }

    protected ParcelableClass(android.os.Parcel source) {
        this.myString = source.readString();
    }

    private static class CreatorImpl implements android.os.Parcelable.Creator<ParcelableClass> {

        public ParcelableClass createFromParcel(android.os.Parcel source) {
            return new ParcelableClass(source);
        }

        public ParcelableClass[] newArray(int size) {
            return new ParcelableClass[size];
        }
    }
}
```

during preprocessing phase. You will never see this code again!

**Optimization hint**: when possible, add `final` to classes with `@Parcelable` annotation. This is to avoid some reflection and storing unnecessary bits of data.<commit_msg>note on adding implements android.os.Parcelable<commit_after>Hrisey [![Build Status](https://travis-ci.org/mg6maciej/hrisey.svg?branch=master)](https://travis-ci.org/mg6maciej/hrisey)
======

Boilerplate code suppressor tool for Android platform based on [Project Lombok](http://projectlombok.org/).

Usage
-----

Add Hrisey as a dependency:

```Groovy
dependencies {
    provided 'pl.mg6.hrisey:hrisey:0.1.1'
}
```

Install [Hrisey Plugin](http://plugins.jetbrains.com/plugin/7462) in IntelliJ IDEA or Android Studio.

And then just start using it:

```Java
@hrisey.Parcelable
class ParcelableClass implements android.os.Parcelable {

    String myString;
}
```

**Note**: adding `implements android.os.Parcelable` seems redundant, but is there only because of [a limitation when using certain Jetbrains APIs](http://devnet.jetbrains.com/message/5515061). Hrisey will generate it if missing, but IDEA / Android Studio will not undestand it.

This will generate

```Java
class ParcelableClass implements android.os.Parcelable {

    public static final android.os.Parcelable.Creator<ParcelableClass> CREATOR = new CreatorImpl();

    String myString;

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(android.os.Parcel dest, int flags) {
        dest.writeString(this.myString);
    }

    protected ParcelableClass(android.os.Parcel source) {
        this.myString = source.readString();
    }

    private static class CreatorImpl implements android.os.Parcelable.Creator<ParcelableClass> {

        public ParcelableClass createFromParcel(android.os.Parcel source) {
            return new ParcelableClass(source);
        }

        public ParcelableClass[] newArray(int size) {
            return new ParcelableClass[size];
        }
    }
}
```

during preprocessing phase. You will never see this code again!

**Optimization hint**: when possible, add `final` to classes with `@Parcelable` annotation to avoid some reflection and storing unnecessary bits of data.
{'fraction_non_alphanumeric': 0.10483870967741936, 'fraction_numerical': 0.0077956989247311825, 'mean_word_length': 3.782776349614396, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, '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': '843820', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1102, 'n_words': 302}