package com.example.vastlib.entity.http

data class Response(
    var code:Int = 0,
    var data:ByteArray = byteArrayOf(),
    var headers:Map<String, List<String>> = emptyMap(),
    var startTime:Long = 0,
    var endTime:Long = 0
) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as Response

        if (code != other.code) return false
        if (!data.contentEquals(other.data)) return false
        if (headers != other.headers) return false
        if (startTime != other.startTime) return false
        if (endTime != other.endTime) return false

        return true
    }

    override fun hashCode(): Int {
        var result = code
        result = 31 * result + data.contentHashCode()
        result = 31 * result + headers.hashCode()
        result = 31 * result + startTime.hashCode()
        result = 31 * result + endTime.hashCode()
        return result
    }

    override fun toString() = ""
}
