geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject cvs commit: incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin TargetImpl.java TargetModuleIDImpl.java
Date Wed, 02 Jun 2004 18:05:46 GMT
jboynes     2004/06/02 11:05:46

  Modified:    modules/deployment/src/java/org/apache/geronimo/deployment/plugin
                        TargetImpl.java TargetModuleIDImpl.java
  Log:
  Implement equals, hashCode and toString
  
  Revision  Changes    Path
  1.4       +20 -1     incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/TargetImpl.java
  
  Index: TargetImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/TargetImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TargetImpl.java	10 Mar 2004 09:58:48 -0000	1.3
  +++ TargetImpl.java	2 Jun 2004 18:05:46 -0000	1.4
  @@ -40,4 +40,23 @@
       public String getDescription() {
           return description;
       }
  +
  +    public String toString() {
  +        return name;
  +    }
  +
  +    public boolean equals(Object o) {
  +        if (this == o) return true;
  +        if (!(o instanceof TargetImpl)) return false;
  +
  +        final TargetImpl target = (TargetImpl) o;
  +
  +        if (!name.equals(target.name)) return false;
  +
  +        return true;
  +    }
  +
  +    public int hashCode() {
  +        return name.hashCode();
  +    }
   }
  
  
  
  1.4       +24 -1     incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/TargetModuleIDImpl.java
  
  Index: TargetModuleIDImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/TargetModuleIDImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TargetModuleIDImpl.java	10 Mar 2004 09:58:48 -0000	1.3
  +++ TargetModuleIDImpl.java	2 Jun 2004 18:05:46 -0000	1.4
  @@ -53,4 +53,27 @@
       public String getWebURL() {
           return null;
       }
  +
  +    public String toString() {
  +        return "[" + target + ", " + moduleID + "]";
  +    }
  +
  +    public boolean equals(Object o) {
  +        if (this == o) return true;
  +        if (!(o instanceof TargetModuleIDImpl)) return false;
  +
  +        final TargetModuleIDImpl targetModuleID = (TargetModuleIDImpl) o;
  +
  +        if (!moduleID.equals(targetModuleID.moduleID)) return false;
  +        if (!target.equals(targetModuleID.target)) return false;
  +
  +        return true;
  +    }
  +
  +    public int hashCode() {
  +        int result;
  +        result = target.hashCode();
  +        result = 29 * result + moduleID.hashCode();
  +        return result;
  +    }
   }
  
  
  

Mime
View raw message