Skip to content

Instantly share code, notes, and snippets.

@markchristopherng
Created August 19, 2019 00:22
Show Gist options
  • Save markchristopherng/af8b4ba4e6bae03bde1288c213227083 to your computer and use it in GitHub Desktop.
Save markchristopherng/af8b4ba4e6bae03bde1288c213227083 to your computer and use it in GitHub Desktop.
Equals method
override fun equals(other: Any?): Boolean {
// same type
if (other == null || other !is Consignment) {
return false
}
// null id
return if (id == null) {
other.id == null
} else id?.equals(other?.id, ignoreCase = true) ?: false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment