diff options
author | Vitaly Takmazov | 2016-04-22 16:41:31 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-04-22 16:41:31 +0300 |
commit | 277077cd978b708f6cdcf9132154342d17978c55 (patch) | |
tree | 05e700d581d11f33643824976cdb98a54734e25e | |
parent | 80cd101bf9291cd9e8b1a883e3148ff95c445cc1 (diff) |
fix tag equality
-rw-r--r-- | src/main/java/com/juick/Tag.java | 12 |
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; } } |