Skip to content

Commit

Permalink
Add equals() and hashCode() (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
landis22b authored and Tulio Garcia committed Mar 25, 2019
1 parent d47f89b commit d1ec5ed
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions addon/src/main/java/com/vaadin/addon/charts/model/ChartType.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,19 @@ protected ChartType(String type) {
public String toString() {
return type;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ChartType)) return false;

ChartType chartType = (ChartType) o;

return type != null ? type.equals(chartType.type) : chartType.type == null;
}

@Override
public int hashCode() {
return type != null ? type.hashCode() : 0;
}
}

0 comments on commit d1ec5ed

Please sign in to comment.