mirror of https://github.com/apache/lucene.git
add .equals/.hashCode
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@359537 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
396229f18d
commit
ca6b9ee2e5
|
@ -18,4 +18,19 @@ public class JakartaRegexpCapabilities implements RegexCapabilities {
|
||||||
char[] prefix = RegexpTunnel.getPrefix(regexp);
|
char[] prefix = RegexpTunnel.getPrefix(regexp);
|
||||||
return prefix == null ? null : new String(prefix);
|
return prefix == null ? null : new String(prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
final JakartaRegexpCapabilities that = (JakartaRegexpCapabilities) o;
|
||||||
|
|
||||||
|
if (regexp != null ? !regexp.equals(that.regexp) : that.regexp != null) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int hashCode() {
|
||||||
|
return (regexp != null ? regexp.hashCode() : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,4 +16,19 @@ public class JavaUtilRegexCapabilities implements RegexCapabilities {
|
||||||
public String prefix() {
|
public String prefix() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
final JavaUtilRegexCapabilities that = (JavaUtilRegexCapabilities) o;
|
||||||
|
|
||||||
|
if (pattern != null ? !pattern.equals(that.pattern) : that.pattern != null) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int hashCode() {
|
||||||
|
return (pattern != null ? pattern.hashCode() : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue