<commit_before>package com.miguelgaeta.bootstrap.mg_websocket.events;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import com.miguelgaeta.bootstrap.mg_log.MGLog;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import rx.Observable;

/**
 * Created by mrkcsc on 4/15/15.
 */
@AllArgsConstructor(staticName = "create") @Getter @ToString @EqualsAndHashCode
public class MGWebsocketEventMessage {

    private String message;

    public Observable<JsonElement> fromJson() {

        return Observable.create(subscriber -> {

            subscriber.onNext(new JsonParser().parse(message));
            subscriber.onCompleted();
        });
    }

    public <T> Observable<T> fromJson(TypeToken typeToken) {

        return Observable.create(subscriber -> {

            T json = new Gson().fromJson(message, typeToken.getType());

            subscriber.onNext(json);
            subscriber.onCompleted();
        });
    }

    public <T> Observable<T> fromJson(Class<T> clazz) {

        return Observable.create(subscriber -> {

            T json = null;

            try {

                json = new Gson().fromJson(message, clazz);

            } catch (IncompatibleClassChangeError e) {

                MGLog.e("Unable to deserialize from class: ", clazz);
            }

            subscriber.onNext(json);
            subscriber.onCompleted();
        });
    }
}
<commit_msg>Ditch the helpers.<commit_after>package com.miguelgaeta.bootstrap.mg_websocket.events;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

/**
 * Created by mrkcsc on 4/15/15.
 */
@AllArgsConstructor(staticName = "create") @Getter @ToString @EqualsAndHashCode
public class MGWebsocketEventMessage {

    private String message;
}

{'fraction_non_alphanumeric': 0.10865087538619979, 'fraction_numerical': 0.005149330587023687, 'mean_word_length': 3.0311203319502074, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, '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': '4447246', 'n_tokens_mistral': 601, 'n_tokens_neox': 579, 'n_words': 114}