Skip to content

Commit

Permalink
Merge pull request #305 from BELUGABEHR/CURATOR-511
Browse files Browse the repository at this point in the history
CURATOR-511: Add toString to ZKPaths PathAndNode
  • Loading branch information
Randgalt committed Mar 22, 2019
2 parents 1552755 + 8a7618f commit 5ff7952
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java
Expand Up @@ -154,6 +154,49 @@ public String getNode()
{
return node;
}

@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + node.hashCode();
result = prime * result + path.hashCode();
return result;
}

@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
PathAndNode other = (PathAndNode) obj;
if (!node.equals(other.node))
{
return false;
}
if (!path.equals(other.path))
{
return false;
}
return true;
}

@Override
public String toString()
{
return "PathAndNode [path=" + path + ", node=" + node + "]";
}
}

/**
Expand Down

0 comments on commit 5ff7952

Please sign in to comment.