SHARE
TWEET

Untitled

a guest May 19th, 2017 38 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class User {
  2.  
  3.     var userId: String? = null
  4.     var email: String? = null
  5.     var userName: String? = null
  6.     var name: String? = null
  7.     var phNumber: String? = null
  8.     var country: String? = null
  9.     var profilePic: String? = null
  10.  
  11.     override fun equals(o: Any?): Boolean {
  12.         if (this === o) return true
  13.         if (o == null || javaClass != o.javaClass) return false
  14.  
  15.         val that = o as UserSample?
  16.  
  17.         if (if (userId != null) userId != that!!.userId else that!!.userId != null) return false
  18.         if (if (email != null) email != that.email else that.email != null) return false
  19.         if (if (userName != null) userName != that.userName else that.userName != null)
  20.             return false
  21.         if (if (name != null) name != that.name else that.name != null) return false
  22.         if (if (phNumber != null) phNumber != that.phNumber else that.phNumber != null)
  23.             return false
  24.         if (if (country != null) country != that.country else that.country != null) return false
  25.         return if (profilePic != null) profilePic == that.profilePic else that.profilePic == null
  26.     }
  27.  
  28.     override fun hashCode(): Int {
  29.         var result = if (userId != null) userId!!.hashCode() else 0
  30.         result = 31 * result + if (email != null) email!!.hashCode() else 0
  31.         result = 31 * result + if (userName != null) userName!!.hashCode() else 0
  32.         result = 31 * result + if (name != null) name!!.hashCode() else 0
  33.         result = 31 * result + if (phNumber != null) phNumber!!.hashCode() else 0
  34.         result = 31 * result + if (country != null) country!!.hashCode() else 0
  35.         result = 31 * result + if (profilePic != null) profilePic!!.hashCode() else 0
  36.         return result
  37.     }
  38.  
  39.     override fun toString(): String {
  40.         return "UserSample{" +
  41.                 "userId='" + userId + '\'' +
  42.                 ", email='" + email + '\'' +
  43.                 ", userName='" + userName + '\'' +
  44.                 ", name='" + name + '\'' +
  45.                 ", phNumber='" + phNumber + '\'' +
  46.                 ", country='" + country + '\'' +
  47.                 ", profilePic='" + profilePic + '\'' +
  48.                 '}'
  49.     }
  50. }
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top