Hey I am actually a beginner in Kotlin. So my ques...
# getting-started
m
Hey I am actually a beginner in Kotlin. So my question is: when I have for example an abstract val status of type status which in the end is just an integer how can I use the val status as Integer(for example to compare to an other integer value) ..?
m
what do you mean by status? can you give a full package name of the class?
m
Copy code
abstract class HttpResponse : HttpMessage, CoroutineScope, Closeable
and then as property you have and then as property you have
Copy code
abstract val status: HttpStatusCode
in the end val status is just an integer...
m
I assume you are talking about https://github.com/ktorio/ktor/blob/master/ktor-http/common/src/io/ktor/http/HttpStatusCode.kt then you can use
status.value
to get the value
but if you want to check for exact status, its better to do something like
status == HttpStatusCode.NotFound
or the most useful
status.isSuccess()
m
Ah I see, it has another property value. Thanks a lot.🙂
👌 1