<commit_before>package com.raizlabs.android.dbflow.sql.language;

import android.text.TextUtils;

import com.raizlabs.android.dbflow.sql.Query;
import com.raizlabs.android.dbflow.sql.QueryBuilder;

/**
 * Description: Represents a column name as an alias to its original name. EX: SELECT `money` AS `myMoney`. However
 * if a an asName is not specified, then at its base this simply represents a column.
 */
public class ColumnAlias implements Query {

    /**
     * @param columnName The name of the column that will use an alias in a query.
     * @return A new instance.
     */
    public static ColumnAlias column(String columnName) {
        return new ColumnAlias(columnName);
    }

    private final String columnName;

    private String asName;

    private ColumnAlias(String columnName) {
        this.columnName = columnName;
    }

    /**
     * Appends the asName after the AS of the query.
     *
     * @param asName The name of the AS `someName`
     * @return This instance.
     */
    public ColumnAlias as(String asName) {
        this.asName = asName;
        return this;
    }

    @Override
    public String getQuery() {
        QueryBuilder queryBuilder = new QueryBuilder();
        queryBuilder.appendQuoted(columnName);
        if (!TextUtils.isEmpty(asName)) {
            queryBuilder.appendSpaceSeparated("AS")
                    .appendQuoted(asName);
        }
        return queryBuilder.getQuery();
    }
}<commit_msg>added toString method for appending to query.<commit_after>package com.raizlabs.android.dbflow.sql.language;

import android.text.TextUtils;

import com.raizlabs.android.dbflow.sql.Query;
import com.raizlabs.android.dbflow.sql.QueryBuilder;

/**
 * Description: Represents a column name as an alias to its original name. EX: SELECT `money` AS `myMoney`. However
 * if a an asName is not specified, then at its base this simply represents a column.
 */
public class ColumnAlias implements Query {

    /**
     * @param columnName The name of the column that will use an alias in a query.
     * @return A new instance.
     */
    public static ColumnAlias column(String columnName) {
        return new ColumnAlias(columnName);
    }

    private final String columnName;

    private String asName;

    private ColumnAlias(String columnName) {
        this.columnName = columnName;
    }

    /**
     * Appends the asName after the AS of the query.
     *
     * @param asName The name of the AS `someName`
     * @return This instance.
     */
    public ColumnAlias as(String asName) {
        this.asName = asName;
        return this;
    }

    @Override
    public String getQuery() {
        QueryBuilder queryBuilder = new QueryBuilder();
        queryBuilder.appendQuoted(columnName);
        if (!TextUtils.isEmpty(asName)) {
            queryBuilder.appendSpaceSeparated("AS")
                    .appendQuoted(asName);
        }
        return queryBuilder.getQuery();
    }

    @Override
    public String toString() {
        return getQuery();
    }
}
{'fraction_non_alphanumeric': 0.08677004289013526, 'fraction_numerical': 0.0, 'mean_word_length': 2.605231866825208, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1376550', 'n_tokens_mistral': 855, 'n_tokens_neox': 838, 'n_words': 270}