mirror of
https://github.com/lightbend/config.git
synced 2025-01-15 23:01:05 +08:00
Implement equals and hashCode for ResolveSource
Useful for debugging or whatever.
This commit is contained in:
parent
c8f42ef92d
commit
0a828f500b
@ -275,6 +275,23 @@ final class ResolveSource {
|
||||
final T value;
|
||||
final Node<T> next;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return value.hashCode() + 41 * (41 + next.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other instanceof Node<?>) {
|
||||
if (value == ((Node<?>) other).value)
|
||||
return true;
|
||||
else
|
||||
return value.equals(((Node<?>) other).value);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Node(T value, Node<T> next) {
|
||||
this.value = value;
|
||||
this.next = next;
|
||||
|
Loading…
Reference in New Issue
Block a user