Created
August 16, 2015 17:39
-
-
Save kevinmorio/9b9e4374923a3f18c236 to your computer and use it in GitHub Desktop.
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
import java.util.Objects; | |
public class Zone { | |
private String name; | |
public Zone(String name) { | |
this.name = name; | |
} | |
@Override | |
public String toString() { | |
return "Zone " + name; | |
} | |
@Override | |
public boolean equals(Object o) { | |
return o instanceof Zone && Objects.equals(((Zone) o).name, this.name); | |
} | |
@Override | |
public int hashCode() { | |
return name.hashCode(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment