Refers to data classes feature in Kotlin programming language.
Questions tagged [data-class]
380 questions
-1
votes
1 answer
from Json to Kotlin Data class
I am working on my frist Android project. I am going to build a news app. The news articles are coming from a api call, but the response body is a little bit more complicated then is thought.
I have the next response body:
{
"Results": [
{
…

Parsa
- 106
- 4
-1
votes
1 answer
How to filter data class properties by kotlin annotation?
Implimentation of Annotation
@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.RUNTIME)
annotation class Returnable
Dummy Data class
data class DataClass(
val property: String
@Returnable
val annotatedProperty:…

Ihar Sadounikau
- 741
- 6
- 20
-2
votes
1 answer
Problem with RetroFit Dataclass, returning null response
When I run the API in browser or without retrofit, it returns a perfect response. But when i pass it through retrofit and gson, it returns null. I thought there must be some problem with the data classes i am using.
My API response
{
"total_count":…

Rishav Naskar
- 73
- 1
- 8
-3
votes
1 answer
What is the difference between Data Class and Regular Class in Kotlin?
Other than the fact that the compiler automatically generates certain functions for Data Class, what is the fundamental difference between them?

Vandit Goel
- 620
- 2
- 9
- 19
-3
votes
1 answer
Data Class in Kotlin
I need to display image by use Data class
I confused in data class I deal with image as image or Int
data class User(val pic : Image)
or
data class User(val pic : Int)
and display it throw CustomAdapter
class CustomAdapter(val userList:…

engmms
- 347
- 1
- 4
- 16