/*
 * The Gemma project.
 * 
 * Copyright (c) 2006 University of British Columbia
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package ubic.gemma.model.expression.arrayDesign;

/**
 * @see ubic.gemma.model.expression.arrayDesign.ArrayDesign
 * @author pavlidis
 * @version $Id$
 */
public class ArrayDesignImpl extends ubic.gemma.model.expression.arrayDesign.ArrayDesign {

    /**
     * The serial version UID of this class. Needed for serialization.
     */
    private static final long serialVersionUID = -3705444380575919171L;

    @Override
    public boolean equals( Object object ) {
        ArrayDesign that = ( ArrayDesign ) object;
        if ( this.getId() != null && that.getId() != null ) return this.getId().equals( that.getId() );

        if ( this.getName() != null && that.getName() != null ) {
            return this.getName().equals( that.getName() );
        }

        return false;
    }

    @Override
    public int hashCode() {
        if ( this.getId() != null ) return 29 * getId().hashCode();
        if ( this.getName() != null ) return 29 * getName().hashCode();
        return super.hashCode();
    }

    @Override
    public java.lang.String toString() {
        return super.toString() + " (" + this.getShortName() + ")";
    }

}
@@ -1,10 +1,11 @@
 /*
+%0D
 %0A * The 
@@ -18,20 +18,22 @@
 project.
+%0D
 %0A * 
+%0D
 %0A * Copy
@@ -77,20 +77,22 @@
 Columbia
+%0D
 %0A * 
+%0D
 %0A * Lice
@@ -150,16 +150,17 @@
 cense%22);
+%0D
 %0A * you 
@@ -219,16 +219,17 @@
 License.
+%0D
 %0A * You 
@@ -263,19 +263,21 @@
 cense at
+%0D
 %0A *
+%0D
 %0A *     
@@ -320,19 +320,21 @@
 ENSE-2.0
+%0D
 %0A *
+%0D
 %0A * Unle
@@ -396,16 +396,17 @@
 software
+%0D
 %0A * dist
@@ -466,16 +466,17 @@
 %22 BASIS,
+%0D
 %0A * WITH
@@ -543,16 +543,17 @@
 implied.
+%0D
 %0A * See 
@@ -615,16 +615,17 @@
 ions and
+%0D
 %0A * limi
@@ -654,15 +654,18 @@
 nse.
+%0D
 %0A *
+%0D
 %0A */
+%0D
 %0Apac
@@ -713,13 +713,16 @@
 ign;
-%0A
+%0D%0A%0D
 %0A/**
+%0D
 %0A * 
@@ -777,16 +777,17 @@
 ayDesign
+%0D
 %0A * @aut
@@ -798,16 +798,17 @@
 pavlidis
+%0D
 %0A * @ver
@@ -816,20 +816,22 @@
 ion $Id$
+%0D
 %0A */
+%0D
 %0Apublic 
@@ -917,17 +917,19 @@
 gn %7B
-%0A
+%0D%0A%0D
 %0A    /**
 %0A   
@@ -924,16 +924,17 @@
 %0A    /**
+%0D
 %0A     * 
@@ -1000,16 +1000,17 @@
 ion.
+%0D
 %0A     */
 %0A   
@@ -1005,16 +1005,17 @@
 %0A     */
+%0D
 %0A    pri
@@ -1078,17 +1078,19 @@
 919171L;
-%0A
+%0D%0A%0D
 %0A    @Ov
@@ -1087,32 +1087,33 @@
 %0A%0D%0A    @Override
+%0D
 %0A    public bool
@@ -1137,24 +1137,90 @@
 t object ) %7B
+%0D%0A        if ( !( object instanceof ArrayDesign ) ) return false;%0D
 %0A        Arr
@@ -1258,16 +1258,17 @@
  object;
+%0D
 %0A       
@@ -1363,17 +1363,19 @@
 tId() );
-%0A
+%0D%0A%0D
 %0A       
@@ -1432,16 +1432,17 @@
 null ) %7B
+%0D
 %0A       
@@ -1493,16 +1493,17 @@
 ame() );
+%0D
 %0A       
@@ -1500,25 +1500,27 @@
 ;%0D%0A        %7D
-%0A
+%0D%0A%0D
 %0A        ret
@@ -1529,23 +1529,26 @@
 n false;
+%0D
 %0A    %7D
-%0A
+%0D%0A%0D
 %0A    @Ov
@@ -1545,32 +1545,33 @@
 %0A%0D%0A    @Override
+%0D
 %0A    public int 
@@ -1578,24 +1578,25 @@
 hashCode() %7B
+%0D
 %0A        if 
@@ -1643,32 +1643,33 @@
 Id().hashCode();
+%0D
 %0A        if ( th
@@ -1720,24 +1720,25 @@
 .hashCode();
+%0D
 %0A        ret
@@ -1758,23 +1758,26 @@
 hCode();
+%0D
 %0A    %7D
-%0A
+%0D%0A%0D
 %0A    @Ov
@@ -1782,16 +1782,17 @@
 Override
+%0D
 %0A    pub
@@ -1824,16 +1824,17 @@
 ring() %7B
+%0D
 %0A       
@@ -1897,13 +1897,16 @@
 %22)%22;
+%0D
 %0A    %7D
-%0A
+%0D%0A%0D
 %0A%7D

fix for 'equals', check object type