Skip to content

Instantly share code, notes, and snippets.

@devrath
Created August 3, 2022 14:59
Show Gist options
  • Select an option

  • Save devrath/32d41ff70767f7a5ba49cc85e0329285 to your computer and use it in GitHub Desktop.

Select an option

Save devrath/32d41ff70767f7a5ba49cc85e0329285 to your computer and use it in GitHub Desktop.
user class extending abstract class
/**
* A data model class for User with required fields.
*/
data class User(
override val id: String = "",
override val firstName: String = "",
override val lastName: String = "",
override val email: String = "",
override val image: String = "",
override val mobile: Long = 0,
override val gender: String = "",
override val profileCompleted: Int = 0
) : UserAbstract(id,firstName,lastName,email,image,mobile,gender,profileCompleted)
/**
* A abstract data model class for User with required fields.
*/
abstract class UserAbstract(
open val id: String,
open val firstName: String,
open val lastName: String,
open val email: String,
open val image: String,
open val mobile: Long,
open val gender: String,
open val profileCompleted: Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment