001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    
019    import java.util.Date;
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link Ticket}.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see Ticket
030     * @generated
031     */
032    public class TicketWrapper implements Ticket, ModelWrapper<Ticket> {
033            public TicketWrapper(Ticket ticket) {
034                    _ticket = ticket;
035            }
036    
037            @Override
038            public Class<?> getModelClass() {
039                    return Ticket.class;
040            }
041    
042            @Override
043            public String getModelClassName() {
044                    return Ticket.class.getName();
045            }
046    
047            @Override
048            public Map<String, Object> getModelAttributes() {
049                    Map<String, Object> attributes = new HashMap<String, Object>();
050    
051                    attributes.put("ticketId", getTicketId());
052                    attributes.put("companyId", getCompanyId());
053                    attributes.put("createDate", getCreateDate());
054                    attributes.put("classNameId", getClassNameId());
055                    attributes.put("classPK", getClassPK());
056                    attributes.put("key", getKey());
057                    attributes.put("type", getType());
058                    attributes.put("extraInfo", getExtraInfo());
059                    attributes.put("expirationDate", getExpirationDate());
060    
061                    return attributes;
062            }
063    
064            @Override
065            public void setModelAttributes(Map<String, Object> attributes) {
066                    Long ticketId = (Long)attributes.get("ticketId");
067    
068                    if (ticketId != null) {
069                            setTicketId(ticketId);
070                    }
071    
072                    Long companyId = (Long)attributes.get("companyId");
073    
074                    if (companyId != null) {
075                            setCompanyId(companyId);
076                    }
077    
078                    Date createDate = (Date)attributes.get("createDate");
079    
080                    if (createDate != null) {
081                            setCreateDate(createDate);
082                    }
083    
084                    Long classNameId = (Long)attributes.get("classNameId");
085    
086                    if (classNameId != null) {
087                            setClassNameId(classNameId);
088                    }
089    
090                    Long classPK = (Long)attributes.get("classPK");
091    
092                    if (classPK != null) {
093                            setClassPK(classPK);
094                    }
095    
096                    String key = (String)attributes.get("key");
097    
098                    if (key != null) {
099                            setKey(key);
100                    }
101    
102                    Integer type = (Integer)attributes.get("type");
103    
104                    if (type != null) {
105                            setType(type);
106                    }
107    
108                    String extraInfo = (String)attributes.get("extraInfo");
109    
110                    if (extraInfo != null) {
111                            setExtraInfo(extraInfo);
112                    }
113    
114                    Date expirationDate = (Date)attributes.get("expirationDate");
115    
116                    if (expirationDate != null) {
117                            setExpirationDate(expirationDate);
118                    }
119            }
120    
121            /**
122            * Returns the primary key of this ticket.
123            *
124            * @return the primary key of this ticket
125            */
126            @Override
127            public long getPrimaryKey() {
128                    return _ticket.getPrimaryKey();
129            }
130    
131            /**
132            * Sets the primary key of this ticket.
133            *
134            * @param primaryKey the primary key of this ticket
135            */
136            @Override
137            public void setPrimaryKey(long primaryKey) {
138                    _ticket.setPrimaryKey(primaryKey);
139            }
140    
141            /**
142            * Returns the ticket ID of this ticket.
143            *
144            * @return the ticket ID of this ticket
145            */
146            @Override
147            public long getTicketId() {
148                    return _ticket.getTicketId();
149            }
150    
151            /**
152            * Sets the ticket ID of this ticket.
153            *
154            * @param ticketId the ticket ID of this ticket
155            */
156            @Override
157            public void setTicketId(long ticketId) {
158                    _ticket.setTicketId(ticketId);
159            }
160    
161            /**
162            * Returns the company ID of this ticket.
163            *
164            * @return the company ID of this ticket
165            */
166            @Override
167            public long getCompanyId() {
168                    return _ticket.getCompanyId();
169            }
170    
171            /**
172            * Sets the company ID of this ticket.
173            *
174            * @param companyId the company ID of this ticket
175            */
176            @Override
177            public void setCompanyId(long companyId) {
178                    _ticket.setCompanyId(companyId);
179            }
180    
181            /**
182            * Returns the create date of this ticket.
183            *
184            * @return the create date of this ticket
185            */
186            @Override
187            public java.util.Date getCreateDate() {
188                    return _ticket.getCreateDate();
189            }
190    
191            /**
192            * Sets the create date of this ticket.
193            *
194            * @param createDate the create date of this ticket
195            */
196            @Override
197            public void setCreateDate(java.util.Date createDate) {
198                    _ticket.setCreateDate(createDate);
199            }
200    
201            /**
202            * Returns the fully qualified class name of this ticket.
203            *
204            * @return the fully qualified class name of this ticket
205            */
206            @Override
207            public java.lang.String getClassName() {
208                    return _ticket.getClassName();
209            }
210    
211            @Override
212            public void setClassName(java.lang.String className) {
213                    _ticket.setClassName(className);
214            }
215    
216            /**
217            * Returns the class name ID of this ticket.
218            *
219            * @return the class name ID of this ticket
220            */
221            @Override
222            public long getClassNameId() {
223                    return _ticket.getClassNameId();
224            }
225    
226            /**
227            * Sets the class name ID of this ticket.
228            *
229            * @param classNameId the class name ID of this ticket
230            */
231            @Override
232            public void setClassNameId(long classNameId) {
233                    _ticket.setClassNameId(classNameId);
234            }
235    
236            /**
237            * Returns the class p k of this ticket.
238            *
239            * @return the class p k of this ticket
240            */
241            @Override
242            public long getClassPK() {
243                    return _ticket.getClassPK();
244            }
245    
246            /**
247            * Sets the class p k of this ticket.
248            *
249            * @param classPK the class p k of this ticket
250            */
251            @Override
252            public void setClassPK(long classPK) {
253                    _ticket.setClassPK(classPK);
254            }
255    
256            /**
257            * Returns the key of this ticket.
258            *
259            * @return the key of this ticket
260            */
261            @Override
262            public java.lang.String getKey() {
263                    return _ticket.getKey();
264            }
265    
266            /**
267            * Sets the key of this ticket.
268            *
269            * @param key the key of this ticket
270            */
271            @Override
272            public void setKey(java.lang.String key) {
273                    _ticket.setKey(key);
274            }
275    
276            /**
277            * Returns the type of this ticket.
278            *
279            * @return the type of this ticket
280            */
281            @Override
282            public int getType() {
283                    return _ticket.getType();
284            }
285    
286            /**
287            * Sets the type of this ticket.
288            *
289            * @param type the type of this ticket
290            */
291            @Override
292            public void setType(int type) {
293                    _ticket.setType(type);
294            }
295    
296            /**
297            * Returns the extra info of this ticket.
298            *
299            * @return the extra info of this ticket
300            */
301            @Override
302            public java.lang.String getExtraInfo() {
303                    return _ticket.getExtraInfo();
304            }
305    
306            /**
307            * Sets the extra info of this ticket.
308            *
309            * @param extraInfo the extra info of this ticket
310            */
311            @Override
312            public void setExtraInfo(java.lang.String extraInfo) {
313                    _ticket.setExtraInfo(extraInfo);
314            }
315    
316            /**
317            * Returns the expiration date of this ticket.
318            *
319            * @return the expiration date of this ticket
320            */
321            @Override
322            public java.util.Date getExpirationDate() {
323                    return _ticket.getExpirationDate();
324            }
325    
326            /**
327            * Sets the expiration date of this ticket.
328            *
329            * @param expirationDate the expiration date of this ticket
330            */
331            @Override
332            public void setExpirationDate(java.util.Date expirationDate) {
333                    _ticket.setExpirationDate(expirationDate);
334            }
335    
336            @Override
337            public boolean isNew() {
338                    return _ticket.isNew();
339            }
340    
341            @Override
342            public void setNew(boolean n) {
343                    _ticket.setNew(n);
344            }
345    
346            @Override
347            public boolean isCachedModel() {
348                    return _ticket.isCachedModel();
349            }
350    
351            @Override
352            public void setCachedModel(boolean cachedModel) {
353                    _ticket.setCachedModel(cachedModel);
354            }
355    
356            @Override
357            public boolean isEscapedModel() {
358                    return _ticket.isEscapedModel();
359            }
360    
361            @Override
362            public java.io.Serializable getPrimaryKeyObj() {
363                    return _ticket.getPrimaryKeyObj();
364            }
365    
366            @Override
367            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
368                    _ticket.setPrimaryKeyObj(primaryKeyObj);
369            }
370    
371            @Override
372            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
373                    return _ticket.getExpandoBridge();
374            }
375    
376            @Override
377            public void setExpandoBridgeAttributes(
378                    com.liferay.portal.model.BaseModel<?> baseModel) {
379                    _ticket.setExpandoBridgeAttributes(baseModel);
380            }
381    
382            @Override
383            public void setExpandoBridgeAttributes(
384                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
385                    _ticket.setExpandoBridgeAttributes(expandoBridge);
386            }
387    
388            @Override
389            public void setExpandoBridgeAttributes(
390                    com.liferay.portal.service.ServiceContext serviceContext) {
391                    _ticket.setExpandoBridgeAttributes(serviceContext);
392            }
393    
394            @Override
395            public java.lang.Object clone() {
396                    return new TicketWrapper((Ticket)_ticket.clone());
397            }
398    
399            @Override
400            public int compareTo(com.liferay.portal.model.Ticket ticket) {
401                    return _ticket.compareTo(ticket);
402            }
403    
404            @Override
405            public int hashCode() {
406                    return _ticket.hashCode();
407            }
408    
409            @Override
410            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Ticket> toCacheModel() {
411                    return _ticket.toCacheModel();
412            }
413    
414            @Override
415            public com.liferay.portal.model.Ticket toEscapedModel() {
416                    return new TicketWrapper(_ticket.toEscapedModel());
417            }
418    
419            @Override
420            public com.liferay.portal.model.Ticket toUnescapedModel() {
421                    return new TicketWrapper(_ticket.toUnescapedModel());
422            }
423    
424            @Override
425            public java.lang.String toString() {
426                    return _ticket.toString();
427            }
428    
429            @Override
430            public java.lang.String toXmlString() {
431                    return _ticket.toXmlString();
432            }
433    
434            @Override
435            public void persist()
436                    throws com.liferay.portal.kernel.exception.SystemException {
437                    _ticket.persist();
438            }
439    
440            @Override
441            public boolean isExpired() {
442                    return _ticket.isExpired();
443            }
444    
445            @Override
446            public boolean equals(Object obj) {
447                    if (this == obj) {
448                            return true;
449                    }
450    
451                    if (!(obj instanceof TicketWrapper)) {
452                            return false;
453                    }
454    
455                    TicketWrapper ticketWrapper = (TicketWrapper)obj;
456    
457                    if (Validator.equals(_ticket, ticketWrapper._ticket)) {
458                            return true;
459                    }
460    
461                    return false;
462            }
463    
464            /**
465             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
466             */
467            public Ticket getWrappedTicket() {
468                    return _ticket;
469            }
470    
471            @Override
472            public Ticket getWrappedModel() {
473                    return _ticket;
474            }
475    
476            @Override
477            public void resetOriginalValues() {
478                    _ticket.resetOriginalValues();
479            }
480    
481            private Ticket _ticket;
482    }