Skip to content

Commit

Permalink
Merge pull request #188 from yaoqiangpersonal/develop
Browse files Browse the repository at this point in the history
overwrite equals and hashcode
  • Loading branch information
a-schild authored Dec 9, 2021
2 parents 734ffa0 + 1694970 commit 2553a71
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion jave-core/src/main/java/ws/schild/jave/info/VideoSize.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
package ws.schild.jave.info;

import java.io.Serializable;
import java.util.Objects;

/**
* Instances of this class report informations about videos size.
* Instances of this class report information about videos size.
*
* @author Carlo Pelliccia
*/
Expand Down Expand Up @@ -118,6 +119,19 @@ public Integer getHeight() {
return height;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
VideoSize videoSize = (VideoSize) o;
return Objects.equals(width, videoSize.width) && Objects.equals(height, videoSize.height);
}

@Override
public int hashCode() {
return Objects.hash(width, height);
}

@Override
public String toString() {
return getClass().getName() + " (width=" + width + ", height=" + height + ")";
Expand Down

0 comments on commit 2553a71

Please sign in to comment.