1+ package com.pengrad.telegrambot.model.gift
2+
3+ import com.pengrad.telegrambot.model.MessageEntity
4+
5+ data class GiftInfo (
6+ @get:JvmName("gift") val gift : Gift ,
7+ @get:JvmName("ownedGiftId") val ownedGiftId : String? ,
8+ @get:JvmName("convertStarCount") val convertStarCount : Int? ,
9+ @get:JvmName("prepaidUpgradeStarCount") val prepaidUpgradeStarCount : Int? ,
10+ @get:JvmName("canBeUpgraded") val canBeUpgraded : Boolean? ,
11+ @get:JvmName("text") val text : String? ,
12+ @get:JvmName("entities") val entities : Array <MessageEntity >? ,
13+ @get:JvmName("isPrivate") val isPrivate : Boolean? ,
14+ ) {
15+
16+ override fun equals (other : Any? ): Boolean {
17+ if (this == = other) return true
18+ if (other !is GiftInfo ) return false
19+
20+ return gift == other.gift &&
21+ ownedGiftId == other.ownedGiftId &&
22+ convertStarCount == other.convertStarCount &&
23+ prepaidUpgradeStarCount == other.prepaidUpgradeStarCount &&
24+ canBeUpgraded == other.canBeUpgraded &&
25+ text == other.text &&
26+ entities contentEquals other.entities &&
27+ isPrivate == other.isPrivate
28+ }
29+
30+ override fun hashCode (): Int {
31+ var result = gift.hashCode()
32+ result = 31 * result + (ownedGiftId?.hashCode() ? : 0 )
33+ result = 31 * result + (convertStarCount ? : 0 )
34+ result = 31 * result + (prepaidUpgradeStarCount ? : 0 )
35+ result = 31 * result + (canBeUpgraded?.hashCode() ? : 0 )
36+ result = 31 * result + (text?.hashCode() ? : 0 )
37+ result = 31 * result + (entities?.contentHashCode() ? : 0 )
38+ result = 31 * result + (isPrivate?.hashCode() ? : 0 )
39+ return result
40+ }
41+
42+ override fun toString (): String {
43+ return " GiftInfo(gift=$gift , ownedGiftId=$ownedGiftId , convertStarCount=$convertStarCount , " +
44+ " prepaidUpgradeStarCount=$prepaidUpgradeStarCount , canBeUpgraded=$canBeUpgraded , " +
45+ " text=$text , entities=${entities?.contentToString()} , isPrivate=$isPrivate )"
46+ }
47+
48+ }
0 commit comments