<commit_before>// Copyright (c) 2017 <NAME>
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
package se.creotec.chscardbalance2.model

class BackendResponse<T> {

    var isSuccess: Boolean = false
    var errorMessage: String = UNKNOWN_ERROR
    var data: T? = null

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other == null || javaClass != other.javaClass) return false
        val that = other as BackendResponse<*>
        if (isSuccess != that.isSuccess || errorMessage != that.errorMessage) return false
        return if (data != null) data == that.data else that.data == null
    }

    override fun hashCode(): Int {
        var result = if (isSuccess) 1 else 0
        result = 37 * result + errorMessage.hashCode()
        result = 37 * result + (data?.hashCode() ?: 0)
        return result
    }

    override fun toString(): String {
        return "BackendResponse{" +
                "success=" + isSuccess +
                ", errorMessage='" + errorMessage + '\'' +
                ", data=" + data +
                '}'<commit_msg>Adds json name to backend response<commit_after>// Copyright (c) 2017 <NAME>
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
package se.creotec.chscardbalance2.model

import com.google.gson.annotations.SerializedName

class BackendResponse<T> {

    @SerializedName("success")
    var isSuccess: Boolean = false
    @SerializedName("error")
    var errorMessage: String = UNKNOWN_ERROR
    @SerializedName("data")
    var data: T? = null

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other == null || javaClass != other.javaClass) return false
        val that = other as BackendResponse<*>
        if (isSuccess != that.isSuccess || errorMessage != that.errorMessage) return false
        return if (data != null) data == that.data else that.data == null
    }

    override fun hashCode(): Int {
        var result = if (isSuccess) 1 else 0
        result = 37 * result + errorMessage.hashCode()
        result = 37 * result + (data?.hashCode() ?: 0)
        return result
    }

    override fun toString(): String {
        return "BackendResponse{" +
                "success=" + isSuccess +
                ", errorMessage='" + errorMessage + '\'' +
                ", data=" + data +
                '}'
{'fraction_non_alphanumeric': 0.1206336311941511, 'fraction_numerical': 0.00974817221770918, 'mean_word_length': 2.383241758241758, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '679624', 'n_tokens_mistral': 703, 'n_tokens_neox': 666, 'n_words': 214}