Created
January 21, 2021 21:40
-
-
Save drawers/462439de70a8970adf8caa68d271f909 to your computer and use it in GitHub Desktop.
Extracting a separate
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
// data layer object | |
open class RealmTask constructor( | |
var title: String = "", | |
var description: String, | |
var isCompleted: Boolean, | |
@PrimaryKey var entryId: String | |
): RealmObject() | |
fun RealmTask.toDomain() { | |
return Task( | |
title = this.title, | |
description = this.description, | |
isCompleted = this.isCompleted, | |
entryId = this.entryId | |
) | |
} | |
// domain layer object | |
data class Task( | |
val title: String, | |
val description: String, | |
val isCompleted: Boolean, | |
val entryId: String | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment