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