<commit_before>/**********************************************************************
 **                                                                   **
 **               This code belongs to the KETTLE project.            **
 **                                                                   **
 ** Kettle, from version 2.2 on, is released into the public domain   **
 ** under the Lesser GNU Public License (LGPL).                       **
 **                                                                   **
 ** For more details, please read the document LICENSE.txt, included  **
 ** in this project                                                   **
 **                                                                   **
 ** http://www.kettle.be                                              **
 ** <EMAIL>                                                    **
 **                                                                   **
 **********************************************************************/

package org.pentaho.di.core;

import org.pentaho.di.trans.step.StepMeta;

/**
 * This class is used to store results of transformation and step verifications.
 * 
 * @author Matt
 * @since 11-01-04
 * 
 */
public class CheckResult
{
    public static final int TYPE_RESULT_NONE = 0;

    public static final int TYPE_RESULT_OK = 1;

    public static final int TYPE_RESULT_COMMENT = 2;

    public static final int TYPE_RESULT_WARNING = 3;

    public static final int TYPE_RESULT_ERROR = 4;

    public static final String typeDesc[] = {
                                             "",
                                             Messages.getString("CheckResult.OK"),
                                             Messages.getString("CheckResult.Remark"),
                                             Messages.getString("CheckResult.Warning"),
                                             Messages.getString("CheckResult.Error")
                                             };

    private int type;

    private String text;

    private StepMeta stepMeta;

    public CheckResult()
    {
        this(TYPE_RESULT_NONE, "", null);
    }

    public CheckResult(int t, String s, StepMeta stepMeta)
    {
        type = t;
        text = s;
        this.stepMeta = stepMeta;
    }

    public int getType()
    {
        return type;
    }

    public String getTypeDesc()
    {
        return typeDesc[type];
    }

    public String getText()
    {
        return text;
    }

    public StepMeta getStepInfo()
    {
        return stepMeta;
    }

    public String toString()
    {
        StringBuffer sb = new StringBuffer();
        sb.append(typeDesc[type]).append(": ").append(text);

        if (stepMeta != null)
            sb.append(" (").append(stepMeta.getName()).append(")");

        return sb.toString();
    }
}<commit_msg>Adding errorcode to validation/check results<commit_after>/**********************************************************************
 **                                                                   **
 **               This code belongs to the KETTLE project.            **
 **                                                                   **
 ** Kettle, from version 2.2 on, is released into the public domain   **
 ** under the Lesser GNU Public License (LGPL).                       **
 **                                                                   **
 ** For more details, please read the document LICENSE.txt, included  **
 ** in this project                                                   **
 **                                                                   **
 ** http://www.kettle.be                                              **
 ** <EMAIL>                                                    **
 **                                                                   **
 **********************************************************************/

package org.pentaho.di.core;

import org.pentaho.di.trans.step.StepMeta;

/**
 * This class is used to store results of transformation and step verifications.
 * 
 * @author Matt
 * @since 11-01-04
 * 
 */
public class CheckResult
{
    public static final int TYPE_RESULT_NONE = 0;

    public static final int TYPE_RESULT_OK = 1;

    public static final int TYPE_RESULT_COMMENT = 2;

    public static final int TYPE_RESULT_WARNING = 3;

    public static final int TYPE_RESULT_ERROR = 4;

    public static final String typeDesc[] = {
                                             "",
                                             Messages.getString("CheckResult.OK"),
                                             Messages.getString("CheckResult.Remark"),
                                             Messages.getString("CheckResult.Warning"),
                                             Messages.getString("CheckResult.Error")
                                             };

    private int type;

    private String text;

    private StepMeta stepMeta;
    
    private String errorCode;

    public CheckResult()
    {
        this(TYPE_RESULT_NONE, "", null);
    }

    public CheckResult(int t, String s, StepMeta stepMeta)
    {
        type = t;
        text = s;
        this.stepMeta = stepMeta;
    }

    public CheckResult(int t, String errorCode, String s, StepMeta stepMeta)
    {
        this(t, s, stepMeta);
        this.errorCode = errorCode;
    }


    public int getType()
    {
        return type;
    }

    public String getTypeDesc()
    {
        return typeDesc[type];
    }

    public String getText()
    {
        return text;
    }

    public StepMeta getStepInfo()
    {
        return stepMeta;
    }

    public String toString()
    {
        StringBuffer sb = new StringBuffer();
        sb.append(typeDesc[type]).append(": ").append(text);

        if (stepMeta != null)
            sb.append(" (").append(stepMeta.getName()).append(")");

        return sb.toString();
    }

    /**
     * @return the errorCode
     */
    public String getErrorCode()
    {
        return errorCode;
    }

    /**
     * @param errorCode the errorCode to set
     */
    public void setErrorCode(String errorCode)
    {
        this.errorCode = errorCode;
    }
}
{'fraction_non_alphanumeric': 0.1292647765497357, 'fraction_numerical': 0.004164664424155053, 'mean_word_length': 1.2032462949894143, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 66, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3617717', 'n_tokens_mistral': 1370, 'n_tokens_neox': 1295, 'n_words': 369}