net.niebes.retrofit.metrics.HttpSeries.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of retrofit-metrics Show documentation
Show all versions of retrofit-metrics Show documentation
Implementation to retry retrofit calls with resilience4j
The newest version!
package net.niebes.retrofit.metrics
enum class HttpSeries(private val value: Int) {
INFORMATIONAL(1),
SUCCESSFUL(2),
REDIRECTION(3),
CLIENT_ERROR(4),
SERVER_ERROR(5),
;
companion object {
fun fromHttpStatus(status: Int): HttpSeries? =
values().firstOrNull { it.value == status / 100 }
}
}