commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder EqualsBuilder.java
Date Sun, 08 Dec 2002 21:10:42 GMT
scolebourne    2002/12/08 13:10:42

  Modified:    lang/src/java/org/apache/commons/lang/builder
                        EqualsBuilder.java
  Log:
  Add ability to build compound equals using superclass
  
  Revision  Changes    Path
  1.7       +18 -1     jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java
  
  Index: EqualsBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- EqualsBuilder.java	17 Nov 2002 21:46:42 -0000	1.6
  +++ EqualsBuilder.java	8 Dec 2002 21:10:42 -0000	1.7
  @@ -82,6 +82,7 @@
    *   }
    *  MyClass rhs = (MyClass) o;
    *  return new EqualsBuilder()
  + *                 .appendSuper(super.equals(o))
    *                 .append(field1, rhs.field1)
    *                 .append(field2, rhs.field2)
    *                 .append(field3, rhs.field3)
  @@ -198,6 +199,22 @@
           return equalsBuilder.isEquals();
       }
   
  +    //-------------------------------------------------------------------------
  +    
  +    /**
  +     * <p>Adds the result of super.equals() to this builder.</p>
  +     *
  +     * @param superEquals  the result of calling <code>super.equals()</code>
  +     * @return EqualsBuilder - used to chain calls.
  +     */
  +    public EqualsBuilder appendSuper(boolean superEquals) {
  +        if (isEquals == false) {
  +            return this;
  +        }
  +        isEquals = superEquals;
  +        return this;
  +    }
  +    
       //-------------------------------------------------------------------------
       
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message