-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from TBCBank/change/add_more_response_values_to…
…_cache Add more response values to cache model
- Loading branch information
Showing
5 changed files
with
91 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 32 additions & 1 deletion
33
retrocache/src/main/java/ge/tbcbank/retrocache/RetroCacheValue.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,40 @@ | ||
package ge.tbcbank.retrocache | ||
|
||
import okhttp3.Protocol | ||
import java.io.Serializable | ||
|
||
data class RetroCacheValue( | ||
val responseJson: String?, | ||
val responseCode: Int, | ||
val responseProtocol: Protocol, | ||
val responseHeaders: Array<String>, | ||
val tag: String? = null, | ||
val expirationTime: Long? = null, | ||
) : Serializable | ||
) : Serializable { | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (this === other) return true | ||
if (javaClass != other?.javaClass) return false | ||
|
||
other as RetroCacheValue | ||
|
||
if (responseJson != other.responseJson) return false | ||
if (responseCode != other.responseCode) return false | ||
if (responseProtocol != other.responseProtocol) return false | ||
if (!responseHeaders.contentEquals(other.responseHeaders)) return false | ||
if (tag != other.tag) return false | ||
return expirationTime == other.expirationTime | ||
} | ||
|
||
override fun hashCode(): Int { | ||
var result = responseJson?.hashCode() ?: 0 | ||
result = 31 * result + responseCode | ||
result = 31 * result + responseProtocol.hashCode() | ||
result = 31 * result + responseHeaders.contentHashCode() | ||
result = 31 * result + (tag?.hashCode() ?: 0) | ||
result = 31 * result + (expirationTime?.hashCode() ?: 0) | ||
return result | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters