<commit_before>package com.mindcoders.phial;

import android.annotation.SuppressLint;
import android.app.Application;

import com.mindcoders.phial.internal.OverlayFactory;
import com.mindcoders.phial.internal.PhialCore;
import com.mindcoders.phial.internal.overlay.Overlay;

/**
 * Created by rost on 10/22/17.
 */

public final class PhialOverlay {
    @SuppressLint("StaticFieldLeak")
    private static PhialCore phialCore;
    @SuppressLint("StaticFieldLeak")
    private static Overlay overlay;

    public static PhialBuilder builder(Application application) {
        return new PhialBuilder(application);
    }

    static void init(PhialBuilder builder) {
        destroy();
        PhialOverlay.phialCore = PhialCore.create(builder);
        PhialOverlay.overlay = OverlayFactory.createOverlay(builder, phialCore);
    }

    public static void destroy() {
        if (phialCore != null) {
            phialCore.destroy();
        }

        if (overlay != null) {
            overlay.destroy();
        }
    }
}<commit_msg>javadoc for PhialOverlay<commit_after>package com.mindcoders.phial;

import android.annotation.SuppressLint;
import android.app.Application;

import com.mindcoders.phial.internal.OverlayFactory;
import com.mindcoders.phial.internal.PhialCore;
import com.mindcoders.phial.internal.overlay.Overlay;

/**
 * Creates PhialOverlay button and pages
 * <p>
 * Use {@link PhialBuilder} to setup
 */
public final class PhialOverlay {
    @SuppressLint("StaticFieldLeak")
    private static PhialCore phialCore;
    @SuppressLint("StaticFieldLeak")
    private static Overlay overlay;

    /**
     * @param application your application
     * @return builder that configures overlays
     */
    public static PhialBuilder builder(Application application) {
        return new PhialBuilder(application);
    }

    static void init(PhialBuilder builder) {
        destroy();
        PhialOverlay.phialCore = PhialCore.create(builder);
        PhialOverlay.overlay = OverlayFactory.createOverlay(builder, phialCore);
    }

    /**
     * removes overlay button and pages
     */
    public static void destroy() {
        if (phialCore != null) {
            phialCore.destroy();
        }

        if (overlay != null) {
            overlay.destroy();
        }
    }
}
{'fraction_non_alphanumeric': 0.09712543554006968, 'fraction_numerical': 0.002613240418118467, 'mean_word_length': 3.0944741532976825, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4441593', 'n_tokens_mistral': 665, 'n_tokens_neox': 664, 'n_words': 144}