<commit_before>package xyz.thepathfinder.android;

import com.google.gson.JsonObject;

/**
 * Access to subscribe operations on models.
 *
 * @param <E> Listener type
 * @author <NAME>
 */
public abstract class SubscribableModel<E extends Listener<? extends Model>> extends Model<E> {

    /**
     * Constructs a subcribable model.
     *
     * @param path of the model to subscribe to.
     * @param services a pathfinder services object.
     */
    public SubscribableModel(String path, PathfinderServices services) {
        super(path, services);
    }

    /**
     * Returns the header of the message to send to the pathfinder server.
     *
     * @param type of the message
     * @return the message header.
     */
    public JsonObject getMessageHeader(String type) {
        JsonObject json = new JsonObject();

        json.addProperty("message", type);

        json.addProperty("id", this.getPath());
        //TODO revert after path update
        //json.addProperty("path", this.getPath());
        json.addProperty("model", this.getModel());

        return json;
    }<commit_msg>Forgot about the message ids needing to be numbers not strings<commit_after>package xyz.thepathfinder.android;

import com.google.gson.JsonObject;

/**
 * Access to subscribe operations on models.
 *
 * @param <E> Listener type
 * @author <NAME>
 */
public abstract class SubscribableModel<E extends Listener<? extends Model>> extends Model<E> {

    /**
     * Constructs a subcribable model.
     *
     * @param path of the model to subscribe to.
     * @param services a pathfinder services object.
     */
    public SubscribableModel(String path, PathfinderServices services) {
        super(path, services);
    }

    /**
     * Returns the header of the message to send to the pathfinder server.
     *
     * @param type of the message
     * @return the message header.
     */
    public JsonObject getMessageHeader(String type) {
        JsonObject json = new JsonObject();

        json.addProperty("message", type);

        json.addProperty("id", Long.parseLong(this.getPath()));
        //TODO revert after path update
        //json.addProperty("path", this.getPath());
        json.addProperty("model", this.getModel());

        return json;
    }
{'fraction_non_alphanumeric': 0.10709563684442486, 'fraction_numerical': 0.0, 'mean_word_length': 2.7582781456953644, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4263201', 'n_tokens_mistral': 634, 'n_tokens_neox': 611, 'n_words': 200}