Created
May 15, 2018 20:51
-
-
Save adrianhall/07d523b9f3c1fb816ca3119627efdc4e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 class Note(val noteId: String = UUID.randomUUID().toString()) { | |
companion object { | |
val DiffCallback = object : DiffUtil.ItemCallback<Note>() { | |
override fun areItemsTheSame(oldItem: Note?, newItem: Note?): Boolean | |
= oldItem != null && newItem != null && oldItem.noteId == newItem.noteId | |
override fun areContentsTheSame(oldItem: Note?, newItem: Note?): Boolean | |
= oldItem != null && newItem != null | |
&& oldItem.noteId == newItem.noteId | |
&& oldItem.title == newItem.title | |
&& oldItem.content == newItem.content | |
} | |
} | |
var title: String = "" | |
var content: String = "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment