Skip to content

Instantly share code, notes, and snippets.

@suddeb
Created May 10, 2015 15:43
Show Gist options
  • Save suddeb/d69cf2b7b80848424b6f to your computer and use it in GitHub Desktop.
Save suddeb/d69cf2b7b80848424b6f to your computer and use it in GitHub Desktop.
MyCustomType with Equals Method Implemented
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