lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/workflow/impl StateImpl.java
Date Wed, 28 May 2003 15:27:32 GMT
andreas     2003/05/28 08:27:32

  Modified:    src/java/org/apache/lenya/cms/workflow/impl StateImpl.java
  Log:
  formatting changed
  added equals() and hashCode()
  
  Revision  Changes    Path
  1.3       +32 -7     cocoon-lenya/src/java/org/apache/lenya/cms/workflow/impl/StateImpl.java
  
  Index: StateImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/workflow/impl/StateImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StateImpl.java	24 Apr 2003 13:53:00 -0000	1.2
  +++ StateImpl.java	28 May 2003 15:27:32 -0000	1.3
  @@ -12,23 +12,48 @@
    *
    * @author  andreas
    */
  -public class StateImpl
  -    implements State {
  -    
  +public class StateImpl implements State {
  +
       /** Creates a new instance of StateImpl */
       public StateImpl(String id) {
           assert id != null;
           this.id = id;
       }
  -    
  +
       private String id;
  -    
  +
  +    /**
  +     * @return
  +     */
       public String getId() {
           return id;
       }
  -    
  +
  +    /* (non-Javadoc)
  +     * @see java.lang.Object#toString()
  +     */
       public String toString() {
           return getId();
       }
  -    
  +
  +    /* (non-Javadoc)
  +     * @see java.lang.Object#equals(java.lang.Object)
  +     */
  +    public boolean equals(Object object) {
  +        boolean result = false;
  +        if (object instanceof StateImpl) {
  +            result = getId().equals(((StateImpl) object).getId());
  +        } else {
  +            result = super.equals(object);
  +        }
  +        return result;
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see java.lang.Object#hashCode()
  +     */
  +    public int hashCode() {
  +        return getId().hashCode();
  +    }
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org


Mime
View raw message