Created
May 10, 2015 15:43
-
-
Save suddeb/d69cf2b7b80848424b6f to your computer and use it in GitHub Desktop.
MyCustomType with Equals Method Implemented
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
public class MyCustomType { | |
public Integer myField {get;set;} | |
public Boolean equals(Object o){ | |
if(this === o){ | |
return true; | |
} | |
if(!(o instanceof MyCustomType)){ | |
return false; | |
}else{ | |
MyCustomType passedMyCustomType = (MyCustomType)o; | |
if(this.myField == passedMyCustomType.myField){ | |
return true; | |
}else{ | |
return false; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment