Source code: org/ahlner/Log4J2DB/beans/LogEventValue.java
1 /*
2 * Generated file - Do not edit!
3 */
4 package org.ahlner.Log4J2DB.beans;
5
6
7 /**
8 * Value object for LogEvent.
9 *
10 */
11 public class LogEventValue
12 extends java.lang.Object
13 implements java.io.Serializable
14 {
15 private java.lang.String eventid;
16 private boolean eventidHasBeenSet = false;
17 private java.lang.String logger;
18 private boolean loggerHasBeenSet = false;
19 private java.lang.String message;
20 private boolean messageHasBeenSet = false;
21 private java.lang.String priority;
22 private boolean priorityHasBeenSet = false;
23 private java.lang.Float timeStamp;
24 private boolean timeStampHasBeenSet = false;
25 private java.lang.String hostName;
26 private boolean hostNameHasBeenSet = false;
27
28 private org.ahlner.Log4J2DB.beans.LogEventPK pk;
29
30 public LogEventValue()
31 {
32 pk = new org.ahlner.Log4J2DB.beans.LogEventPK();
33 }
34
35 public LogEventValue( java.lang.String eventid,java.lang.String logger,java.lang.String message,java.lang.String priority,java.lang.Float timeStamp,java.lang.String hostName )
36 {
37 this.eventid = eventid;
38 eventidHasBeenSet = true;
39 this.logger = logger;
40 loggerHasBeenSet = true;
41 this.message = message;
42 messageHasBeenSet = true;
43 this.priority = priority;
44 priorityHasBeenSet = true;
45 this.timeStamp = timeStamp;
46 timeStampHasBeenSet = true;
47 this.hostName = hostName;
48 hostNameHasBeenSet = true;
49 pk = new org.ahlner.Log4J2DB.beans.LogEventPK(this.getEventid());
50 }
51
52 //TODO Cloneable is better than this !
53 public LogEventValue( LogEventValue otherValue )
54 {
55 this.eventid = otherValue.eventid;
56 eventidHasBeenSet = true;
57 this.logger = otherValue.logger;
58 loggerHasBeenSet = true;
59 this.message = otherValue.message;
60 messageHasBeenSet = true;
61 this.priority = otherValue.priority;
62 priorityHasBeenSet = true;
63 this.timeStamp = otherValue.timeStamp;
64 timeStampHasBeenSet = true;
65 this.hostName = otherValue.hostName;
66 hostNameHasBeenSet = true;
67
68 pk = new org.ahlner.Log4J2DB.beans.LogEventPK(this.getEventid());
69 }
70
71 public org.ahlner.Log4J2DB.beans.LogEventPK getPrimaryKey()
72 {
73 return pk;
74 }
75
76 public void setPrimaryKey( org.ahlner.Log4J2DB.beans.LogEventPK pk )
77 {
78 // it's also nice to update PK object - just in case
79 // somebody would ask for it later...
80 this.pk = pk;
81 setEventid( pk.eventid );
82 }
83
84 public java.lang.String getEventid()
85 {
86 return this.eventid;
87 }
88
89 public void setEventid( java.lang.String eventid )
90 {
91 this.eventid = eventid;
92 eventidHasBeenSet = true;
93
94 pk.setEventid(eventid);
95 }
96
97 public boolean eventidHasBeenSet(){
98 return eventidHasBeenSet;
99 }
100 public java.lang.String getLogger()
101 {
102 return this.logger;
103 }
104
105 public void setLogger( java.lang.String logger )
106 {
107 this.logger = logger;
108 loggerHasBeenSet = true;
109
110 }
111
112 public boolean loggerHasBeenSet(){
113 return loggerHasBeenSet;
114 }
115 public java.lang.String getMessage()
116 {
117 return this.message;
118 }
119
120 public void setMessage( java.lang.String message )
121 {
122 this.message = message;
123 messageHasBeenSet = true;
124
125 }
126
127 public boolean messageHasBeenSet(){
128 return messageHasBeenSet;
129 }
130 public java.lang.String getPriority()
131 {
132 return this.priority;
133 }
134
135 public void setPriority( java.lang.String priority )
136 {
137 this.priority = priority;
138 priorityHasBeenSet = true;
139
140 }
141
142 public boolean priorityHasBeenSet(){
143 return priorityHasBeenSet;
144 }
145 public java.lang.Float getTimeStamp()
146 {
147 return this.timeStamp;
148 }
149
150 public void setTimeStamp( java.lang.Float timeStamp )
151 {
152 this.timeStamp = timeStamp;
153 timeStampHasBeenSet = true;
154
155 }
156
157 public boolean timeStampHasBeenSet(){
158 return timeStampHasBeenSet;
159 }
160 public java.lang.String getHostName()
161 {
162 return this.hostName;
163 }
164
165 public void setHostName( java.lang.String hostName )
166 {
167 this.hostName = hostName;
168 hostNameHasBeenSet = true;
169
170 }
171
172 public boolean hostNameHasBeenSet(){
173 return hostNameHasBeenSet;
174 }
175
176 public String toString()
177 {
178 StringBuffer str = new StringBuffer("{");
179
180 str.append("eventid=" + getEventid() + " " + "logger=" + getLogger() + " " + "message=" + getMessage() + " " + "priority=" + getPriority() + " " + "timeStamp=" + getTimeStamp() + " " + "hostName=" + getHostName());
181 str.append('}');
182
183 return(str.toString());
184 }
185
186 /**
187 * A Value object have an identity if its attributes making its Primary Key
188 * has all been set. One object without identity is never equal to any other
189 * object.
190 *
191 * @return true if this instance have an identity.
192 */
193 protected boolean hasIdentity()
194 {
195 boolean ret = true;
196 ret = ret && eventidHasBeenSet;
197 return ret;
198 }
199
200 public boolean equals(Object other)
201 {
202 if (this == other)
203 return true;
204 if ( ! hasIdentity() ) return false;
205 if (other instanceof LogEventValue)
206 {
207 LogEventValue that = (LogEventValue) other;
208 if ( ! that.hasIdentity() ) return false;
209 boolean lEquals = true;
210 if( this.eventid == null )
211 {
212 lEquals = lEquals && ( that.eventid == null );
213 }
214 else
215 {
216 lEquals = lEquals && this.eventid.equals( that.eventid );
217 }
218
219 lEquals = lEquals && isIdentical(that);
220
221 return lEquals;
222 }
223 else
224 {
225 return false;
226 }
227 }
228
229 public boolean isIdentical(Object other)
230 {
231 if (other instanceof LogEventValue)
232 {
233 LogEventValue that = (LogEventValue) other;
234 boolean lEquals = true;
235 if( this.logger == null )
236 {
237 lEquals = lEquals && ( that.logger == null );
238 }
239 else
240 {
241 lEquals = lEquals && this.logger.equals( that.logger );
242 }
243 if( this.message == null )
244 {
245 lEquals = lEquals && ( that.message == null );
246 }
247 else
248 {
249 lEquals = lEquals && this.message.equals( that.message );
250 }
251 if( this.priority == null )
252 {
253 lEquals = lEquals && ( that.priority == null );
254 }
255 else
256 {
257 lEquals = lEquals && this.priority.equals( that.priority );
258 }
259 if( this.timeStamp == null )
260 {
261 lEquals = lEquals && ( that.timeStamp == null );
262 }
263 else
264 {
265 lEquals = lEquals && this.timeStamp.equals( that.timeStamp );
266 }
267 if( this.hostName == null )
268 {
269 lEquals = lEquals && ( that.hostName == null );
270 }
271 else
272 {
273 lEquals = lEquals && this.hostName.equals( that.hostName );
274 }
275
276 return lEquals;
277 }
278 else
279 {
280 return false;
281 }
282 }
283
284 public int hashCode(){
285 int result = 17;
286 result = 37*result + ((this.eventid != null) ? this.eventid.hashCode() : 0);
287
288 result = 37*result + ((this.logger != null) ? this.logger.hashCode() : 0);
289
290 result = 37*result + ((this.message != null) ? this.message.hashCode() : 0);
291
292 result = 37*result + ((this.priority != null) ? this.priority.hashCode() : 0);
293
294 result = 37*result + ((this.timeStamp != null) ? this.timeStamp.hashCode() : 0);
295
296 result = 37*result + ((this.hostName != null) ? this.hostName.hashCode() : 0);
297
298 return result;
299 }
300
301 }