aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-04-22 16:41:31 +0300
committerGravatar Vitaly Takmazov2016-04-22 16:41:31 +0300
commit277077cd978b708f6cdcf9132154342d17978c55 (patch)
tree05e700d581d11f33643824976cdb98a54734e25e /src
parent80cd101bf9291cd9e8b1a883e3148ff95c445cc1 (diff)
fix tag equality
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/juick/Tag.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/juick/Tag.java b/src/main/java/com/juick/Tag.java
index 3cee3358..119aad99 100644
--- a/src/main/java/com/juick/Tag.java
+++ b/src/main/java/com/juick/Tag.java
@@ -17,11 +17,13 @@
*/
package com.juick;
+import java.util.Objects;
+
/**
*
* @author Ugnich Anton
*/
-public class Tag implements Comparable<Tag> {
+public class Tag {
public String Name = null;
public int TID = 0;
@@ -29,7 +31,11 @@ public class Tag implements Comparable<Tag> {
public int UsageCnt = 0;
@Override
- public int compareTo(Tag o) {
- return this.Name.compareTo(o.Name);
+ public boolean equals(Object o) {
+ boolean equal = false;
+ if (o != null && o instanceof Tag) {
+ equal = Objects.equals(Name, ((Tag) o).Name);
+ }
+ return equal;
}
}