aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/model')
-rw-r--r--src/main/java/com/juick/model/Reaction.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/com/juick/model/Reaction.java b/src/main/java/com/juick/model/Reaction.java
index 4b3501d4..3f666cf6 100644
--- a/src/main/java/com/juick/model/Reaction.java
+++ b/src/main/java/com/juick/model/Reaction.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2020, Juick
+ * Copyright (C) 2008-2023, Juick
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -20,6 +20,7 @@ package com.juick.model;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.io.Serializable;
+import java.util.Objects;
public class Reaction implements Serializable {
@@ -41,6 +42,16 @@ public class Reaction implements Serializable {
.append("count", count)
.build();
}
+ @Override
+ public boolean equals(Object o) {
+ return o == this ||
+ (o instanceof Reaction) && Objects.equals(id, ((Reaction) o).id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
public String getDescription() {
return description;