Github user brandtg commented on a diff in the pull request:

    https://github.com/apache/helix/pull/21#discussion_r27347827
  
    --- Diff: helix-ui/src/main/java/org/apache/helix/ui/api/ResourceSpec.java 
---
    @@ -0,0 +1,31 @@
    +package org.apache.helix.ui.api;
    +
    +public class ResourceSpec extends ClusterSpec {
    +    private final String resourceName;
    +
    +    public ResourceSpec(String zkAddress, String clusterName, String 
resourceName) {
    +        super(zkAddress, clusterName);
    +        this.resourceName = resourceName;
    +    }
    +
    +    public String getResourceName() {
    +        return resourceName;
    +    }
    +
    +    @Override
    +    public boolean equals(Object o) {
    +        if (!(o instanceof ResourceSpec)) {
    +            return false;
    +        }
    +        ResourceSpec c = (ResourceSpec) o;
    +        return getZkAddress().equals(c.getZkAddress())
    +                && getClusterName().equals(c.getClusterName())
    +                && resourceName.equals(c.getResourceName());
    +    }
    +
    +    @Override
    +    public int hashCode() {
    +        return super.hashCode() + 27 * resourceName.hashCode();
    --- End diff --
    
    Probably a good idea, but I didn't know about it while writing this. Do you 
think this should be changed? I don't know if it really matters in this case 
because we're not putting a million of them in a HashMap or anything.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to