Created
August 19, 2019 00:22
-
-
Save markchristopherng/af8b4ba4e6bae03bde1288c213227083 to your computer and use it in GitHub Desktop.
Equals method
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
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