1 2 package org.roller.pojos; 3 4 5 14 public class RoleData 15 extends org.roller.pojos.PersistentObject 16 implements java.io.Serializable 17 { 18 static final long serialVersionUID = -4254083071697970972L; 19 20 protected java.lang.String id; 21 protected java.lang.String userName; 22 protected UserData user; 23 protected java.lang.String role; 24 25 public RoleData() 26 { 27 } 28 29 public RoleData(String id, UserData user, String role) 30 { 31 this.id = id; 32 this.userName = user.getUserName(); 33 this.user = user; 34 this.role = role; 35 } 36 37 public RoleData( RoleData otherData ) 38 { 39 this.id = otherData.id; 40 this.userName = otherData.userName; 41 this.user = otherData.user; 42 this.role = otherData.role; 43 44 } 45 46 52 public java.lang.String getId() 53 { 54 return this.id; 55 } 56 57 public void setId( java.lang.String id ) 58 { 59 this.id = id; 60 } 61 62 66 public java.lang.String getUserName() 67 { 68 return this.userName; 69 } 70 71 public void setUserName( java.lang.String userName ) 72 { 73 this.userName = userName; 74 } 75 76 80 public UserData getUser() 81 { 82 return this.user; 83 } 84 85 public void setUser( UserData user ) 86 { 87 this.user = user; 88 } 89 90 94 public java.lang.String getRole() 95 { 96 return this.role; 97 } 98 99 public void setRole( java.lang.String role ) 100 { 101 this.role = role; 102 } 103 104 public String toString() 105 { 106 StringBuffer str = new StringBuffer ("{"); 107 108 str.append("id=" + id + " " + "userName=" + userName + " " + "user=" + user + " " + "role=" + role); 109 str.append('}'); 110 111 return(str.toString()); 112 } 113 114 public boolean equals( Object pOther ) 115 { 116 if( pOther instanceof RoleData ) 117 { 118 RoleData lTest = (RoleData) pOther; 119 boolean lEquals = true; 120 121 if( this.id == null ) 122 { 123 lEquals = lEquals && ( lTest.id == null ); 124 } 125 else 126 { 127 lEquals = lEquals && this.id.equals( lTest.id ); 128 } 129 if( this.userName == null ) 130 { 131 lEquals = lEquals && ( lTest.userName == null ); 132 } 133 else 134 { 135 lEquals = lEquals && this.userName.equals( lTest.userName ); 136 } 137 if( this.user == null ) 138 { 139 lEquals = lEquals && ( lTest.user == null ); 140 } 141 else 142 { 143 lEquals = lEquals && this.user.equals( lTest.user ); 144 } 145 if( this.role == null ) 146 { 147 lEquals = lEquals && ( lTest.role == null ); 148 } 149 else 150 { 151 lEquals = lEquals && this.role.equals( lTest.role ); 152 } 153 154 return lEquals; 155 } 156 else 157 { 158 return false; 159 } 160 } 161 162 public int hashCode() 163 { 164 int result = 17; 165 result = 37*result + ((this.id != null) ? this.id.hashCode() : 0); 166 result = 37*result + ((this.userName != null) ? this.userName.hashCode() : 0); 167 result = 37*result + ((this.user != null) ? this.user.hashCode() : 0); 168 result = 37*result + ((this.role != null) ? this.role.hashCode() : 0); 169 return result; 170 } 171 172 175 public void setData( org.roller.pojos.PersistentObject otherData ) 176 { 177 178 this.id = ((RoleData)otherData).id; 179 180 this.userName = ((RoleData)otherData).userName; 181 182 this.user = ((RoleData)otherData).user; 183 184 this.role = ((RoleData)otherData).role; 185 } 186 187 } 188 | Popular Tags |