Skip to content

Instantly share code, notes, and snippets.

@kevinmorio
Created August 16, 2015 17:39
Show Gist options
  • Save kevinmorio/9b9e4374923a3f18c236 to your computer and use it in GitHub Desktop.
Save kevinmorio/9b9e4374923a3f18c236 to your computer and use it in GitHub Desktop.
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