<commit_before>/*
 * Copyright (C) 2017 Clivern. <https://clivern.com>
 */
package com.clivern.racter.receivers;

import com.clivern.racter.utils.Config;
import com.clivern.racter.utils.Log;

/**
 * Verify Webhook
 */
public class VerifyWebhook {

    protected String hub_mode;
    protected String hub_verify_token;
    protected String hub_challenge;

    protected Config configs;
    protected Log log;

    /**
     * Constructor
     *
     * @param  configs
     * @param  log
     */
    public VerifyWebhook(Config configs, Log log)
    {
        this.configs = configs;
        this.log = log;
    }

    /**
     * Set Hub Mode
     *
     * @param hub_mode
     */
    public void setHubMode(String hub_mode)
    {
        this.hub_mode = hub_mode;
    }

    /**
     * Set Hub Verify Token
     *
     * @param hub_verify_token
     */
    public void setHubVerifyToken(String hub_verify_token)
    {
        this.hub_verify_token = hub_verify_token;
    }

    /**
     * Set Hub Challenge
     *
     * @param hub_challenge
     */
    public void setHubChallenge(String hub_challenge)
    {
        this.hub_challenge = hub_challenge;
    }

    /**
     * Get Hub Mode
     *
     * @return String
     */
    public String getHubMode()
    {
        return this.hub_mode;
    }

    /**
     * Get Hub Verify Token
     *
     * @return String
     */
    public String getHubVerifyToken()
    {
        return this.hub_verify_token;
    }

    /**
     * Get Hub Challenge
     *
     * @return String
     */
    public String getHubChallenge()
    {
        return this.hub_challenge;
    }

    /**
     * Verify Challenge Data
     *
     * @return boolean
     */
    public Boolean challenge()
    {
        if( (this.hub_mode.equals("subscribe")) && (this.hub_verify_token.equals(this.configs.get("verify_token", ""))) ){
            this.log.info("Verify token validated successfully.");
            return true;
        }

        this.log.severe("Error validating verify token.");
        return false;
    }
}<commit_msg>doc blocks added to verify class<commit_after>/*
 * Copyright (C) 2017 Clivern. <https://clivern.com>
 */
package com.clivern.racter.receivers;

import com.clivern.racter.utils.Config;
import com.clivern.racter.utils.Log;

/**
 * Verify Webhook
 */
public class VerifyWebhook {

    /**
     * @var String
     */
    protected String hub_mode;

    /**
     * @var String
     */
    protected String hub_verify_token;

    /**
     * @var String
     */
    protected String hub_challenge;

    /**
     * @var Config an instance of config class
     */
    protected Config configs;

    /**
     * @var Log an instance of log class
     */
    protected Log log;


    /**
     * Class Constructor
     *
     * @param  configs
     * @param  log
     * @return void
     */
    public VerifyWebhook(Config configs, Log log)
    {
        this.configs = configs;
        this.log = log;
    }

    /**
     * Set Hub Mode
     *
     * @param hub_mode
     * @return void
     */
    public void setHubMode(String hub_mode)
    {
        this.hub_mode = hub_mode;
    }

    /**
     * Set Hub Verify Token
     *
     * @param hub_verify_token
     * @return void
     */
    public void setHubVerifyToken(String hub_verify_token)
    {
        this.hub_verify_token = hub_verify_token;
    }

    /**
     * Set Hub Challenge
     *
     * @param hub_challenge
     * @return void
     */
    public void setHubChallenge(String hub_challenge)
    {
        this.hub_challenge = hub_challenge;
    }

    /**
     * Get Hub Mode
     *
     * @return String
     */
    public String getHubMode()
    {
        return this.hub_mode;
    }

    /**
     * Get Hub Verify Token
     *
     * @return String
     */
    public String getHubVerifyToken()
    {
        return this.hub_verify_token;
    }

    /**
     * Get Hub Challenge
     *
     * @return String
     */
    public String getHubChallenge()
    {
        return this.hub_challenge;
    }

    /**
     * Verify Challenge Data
     *
     * @return boolean
     */
    public Boolean challenge()
    {
        if( (this.hub_mode.equals("subscribe")) && (this.hub_verify_token.equals(this.configs.get("verify_token", ""))) ){
            this.log.info("Verify token validated successfully.");
            return true;
        }

        this.log.severe("Error validating verify token.");
        return false;
    }
}
{'fraction_non_alphanumeric': 0.10833333333333334, 'fraction_numerical': 0.0018018018018018018, 'mean_word_length': 1.8036616161616161, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '4331558', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1369, 'n_words': 302}