1 4 package org.jboss.test.cmp2.cmrtree.ejb; 5 6 9 public class APK 10 extends java.lang.Object 11 implements java.io.Serializable 12 { 13 private int _hashCode = 0; 14 private StringBuffer _toStringValue = null; 15 16 public int majorId; 17 public java.lang.String minorId; 18 19 public APK() 20 { 21 } 22 23 public APK( int majorId,java.lang.String minorId ) 24 { 25 this.majorId = majorId; 26 this.minorId = minorId; 27 } 28 29 public int getMajorId() 30 { 31 return majorId; 32 } 33 public java.lang.String getMinorId() 34 { 35 return minorId; 36 } 37 38 public void setMajorId(int majorId) 39 { 40 this.majorId = majorId; 41 _hashCode = 0; 42 } 43 public void setMinorId(java.lang.String minorId) 44 { 45 this.minorId = minorId; 46 _hashCode = 0; 47 } 48 49 public int hashCode() 50 { 51 if( _hashCode == 0 ) 52 { 53 _hashCode += (int)this.majorId; 54 if (this.minorId != null) _hashCode += this.minorId.hashCode(); 55 } 56 57 return _hashCode; 58 } 59 60 public boolean equals(Object obj) 61 { 62 if( !(obj instanceof org.jboss.test.cmp2.cmrtree.ejb.APK) ) 63 return false; 64 65 org.jboss.test.cmp2.cmrtree.ejb.APK pk = (org.jboss.test.cmp2.cmrtree.ejb.APK)obj; 66 boolean eq = true; 67 68 if( obj == null ) 69 { 70 eq = false; 71 } 72 else 73 { 74 eq = eq && this.majorId == pk.majorId; 75 if( this.minorId == null && ((org.jboss.test.cmp2.cmrtree.ejb.APK)obj).getMinorId() == null ) 76 { 77 eq = true; 78 } 79 else 80 { 81 if( this.minorId == null || ((org.jboss.test.cmp2.cmrtree.ejb.APK)obj).getMinorId() == null ) 82 { 83 eq = false; 84 } 85 else 86 { 87 eq = eq && this.minorId.equals( pk.minorId ); 88 } 89 } 90 } 91 92 return eq; 93 } 94 95 96 public String toString() 97 { 98 if( _toStringValue == null ) 99 { 100 _toStringValue = new StringBuffer ("[."); 101 _toStringValue.append(this.majorId).append('.'); 102 _toStringValue.append(this.minorId).append('.'); 103 _toStringValue.append(']'); 104 } 105 106 return _toStringValue.toString(); 107 } 108 109 } 110 | Popular Tags |