Удалил equals и hashCode

This commit is contained in:
Struchkov Mark 2022-08-02 21:54:41 +03:00
parent e71083fa91
commit 53912a7a75
2 changed files with 2 additions and 26 deletions

View File

@ -6,7 +6,7 @@
<groupId>dev.struchkov</groupId> <groupId>dev.struchkov</groupId>
<artifactId>autoresponder</artifactId> <artifactId>autoresponder</artifactId>
<version>3.4.0</version> <version>3.5.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Abstract Autoresponder</name> <name>Abstract Autoresponder</name>
@ -27,7 +27,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<haiti.utils.ver>1.2.0</haiti.utils.ver> <haiti.utils.ver>1.4.0</haiti.utils.ver>
<junit.ver>5.8.2</junit.ver> <junit.ver>5.8.2</junit.ver>
<slf4j.ver>1.7.36</slf4j.ver> <slf4j.ver>1.7.36</slf4j.ver>

View File

@ -1,7 +1,6 @@
package dev.struchkov.autoresponder.entity; package dev.struchkov.autoresponder.entity;
import java.util.Collection; import java.util.Collection;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -130,27 +129,4 @@ public abstract class Unit<U extends Unit<U, M>, M extends DeliverableText> {
this.triggerCheck = triggerCheck; this.triggerCheck = triggerCheck;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Unit<?, ?> unit = (Unit<?, ?>) o;
return Objects.equals(triggerWords, unit.triggerWords) && Objects.equals(phrases, unit.phrases) && Objects.equals(matchThreshold, unit.matchThreshold) && Objects.equals(priority, unit.priority);
}
@Override
public int hashCode() {
return Objects.hash(triggerWords, phrases, matchThreshold, priority);
}
@Override
public String toString() {
return "Unit{" +
"keyWords=" + triggerWords +
", phrases='" + phrases + '\'' +
", matchThreshold=" + matchThreshold +
", priority=" + priority +
'}';
}
} }