mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-05-31 17:22:11 +00:00
Add missing hashCode and equals methods to JoinField.
Original Pull Request #1847 Closes #1846
This commit is contained in:
parent
3871d2d073
commit
a16a87f3fa
@ -15,11 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.data.elasticsearch.core.join;
|
package org.springframework.data.elasticsearch.core.join;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import org.springframework.data.annotation.PersistenceConstructor;
|
import org.springframework.data.annotation.PersistenceConstructor;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Subhobrata Dey
|
* @author Subhobrata Dey
|
||||||
|
* @author Sascha Woo
|
||||||
* @since 4.1
|
* @since 4.1
|
||||||
*/
|
*/
|
||||||
public class JoinField<ID> {
|
public class JoinField<ID> {
|
||||||
@ -54,4 +57,21 @@ public class JoinField<ID> {
|
|||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(name, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof JoinField)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
JoinField other = (JoinField) obj;
|
||||||
|
return Objects.equals(name, other.name) && Objects.equals(parent, other.parent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user