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            public Class<?> getModelClass() {
038                    return Ticket.class;
039            }
040    
041            public String getModelClassName() {
042                    return Ticket.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("ticketId", getTicketId());
049                    attributes.put("companyId", getCompanyId());
050                    attributes.put("createDate", getCreateDate());
051                    attributes.put("classNameId", getClassNameId());
052                    attributes.put("classPK", getClassPK());
053                    attributes.put("key", getKey());
054                    attributes.put("type", getType());
055                    attributes.put("extraInfo", getExtraInfo());
056                    attributes.put("expirationDate", getExpirationDate());
057    
058                    return attributes;
059            }
060    
061            public void setModelAttributes(Map<String, Object> attributes) {
062                    Long ticketId = (Long)attributes.get("ticketId");
063    
064                    if (ticketId != null) {
065                            setTicketId(ticketId);
066                    }
067    
068                    Long companyId = (Long)attributes.get("companyId");
069    
070                    if (companyId != null) {
071                            setCompanyId(companyId);
072                    }
073    
074                    Date createDate = (Date)attributes.get("createDate");
075    
076                    if (createDate != null) {
077                            setCreateDate(createDate);
078                    }
079    
080                    Long classNameId = (Long)attributes.get("classNameId");
081    
082                    if (classNameId != null) {
083                            setClassNameId(classNameId);
084                    }
085    
086                    Long classPK = (Long)attributes.get("classPK");
087    
088                    if (classPK != null) {
089                            setClassPK(classPK);
090                    }
091    
092                    String key = (String)attributes.get("key");
093    
094                    if (key != null) {
095                            setKey(key);
096                    }
097    
098                    Integer type = (Integer)attributes.get("type");
099    
100                    if (type != null) {
101                            setType(type);
102                    }
103    
104                    String extraInfo = (String)attributes.get("extraInfo");
105    
106                    if (extraInfo != null) {
107                            setExtraInfo(extraInfo);
108                    }
109    
110                    Date expirationDate = (Date)attributes.get("expirationDate");
111    
112                    if (expirationDate != null) {
113                            setExpirationDate(expirationDate);
114                    }
115            }
116    
117            /**
118            * Returns the primary key of this ticket.
119            *
120            * @return the primary key of this ticket
121            */
122            public long getPrimaryKey() {
123                    return _ticket.getPrimaryKey();
124            }
125    
126            /**
127            * Sets the primary key of this ticket.
128            *
129            * @param primaryKey the primary key of this ticket
130            */
131            public void setPrimaryKey(long primaryKey) {
132                    _ticket.setPrimaryKey(primaryKey);
133            }
134    
135            /**
136            * Returns the ticket ID of this ticket.
137            *
138            * @return the ticket ID of this ticket
139            */
140            public long getTicketId() {
141                    return _ticket.getTicketId();
142            }
143    
144            /**
145            * Sets the ticket ID of this ticket.
146            *
147            * @param ticketId the ticket ID of this ticket
148            */
149            public void setTicketId(long ticketId) {
150                    _ticket.setTicketId(ticketId);
151            }
152    
153            /**
154            * Returns the company ID of this ticket.
155            *
156            * @return the company ID of this ticket
157            */
158            public long getCompanyId() {
159                    return _ticket.getCompanyId();
160            }
161    
162            /**
163            * Sets the company ID of this ticket.
164            *
165            * @param companyId the company ID of this ticket
166            */
167            public void setCompanyId(long companyId) {
168                    _ticket.setCompanyId(companyId);
169            }
170    
171            /**
172            * Returns the create date of this ticket.
173            *
174            * @return the create date of this ticket
175            */
176            public java.util.Date getCreateDate() {
177                    return _ticket.getCreateDate();
178            }
179    
180            /**
181            * Sets the create date of this ticket.
182            *
183            * @param createDate the create date of this ticket
184            */
185            public void setCreateDate(java.util.Date createDate) {
186                    _ticket.setCreateDate(createDate);
187            }
188    
189            /**
190            * Returns the fully qualified class name of this ticket.
191            *
192            * @return the fully qualified class name of this ticket
193            */
194            public java.lang.String getClassName() {
195                    return _ticket.getClassName();
196            }
197    
198            public void setClassName(java.lang.String className) {
199                    _ticket.setClassName(className);
200            }
201    
202            /**
203            * Returns the class name ID of this ticket.
204            *
205            * @return the class name ID of this ticket
206            */
207            public long getClassNameId() {
208                    return _ticket.getClassNameId();
209            }
210    
211            /**
212            * Sets the class name ID of this ticket.
213            *
214            * @param classNameId the class name ID of this ticket
215            */
216            public void setClassNameId(long classNameId) {
217                    _ticket.setClassNameId(classNameId);
218            }
219    
220            /**
221            * Returns the class p k of this ticket.
222            *
223            * @return the class p k of this ticket
224            */
225            public long getClassPK() {
226                    return _ticket.getClassPK();
227            }
228    
229            /**
230            * Sets the class p k of this ticket.
231            *
232            * @param classPK the class p k of this ticket
233            */
234            public void setClassPK(long classPK) {
235                    _ticket.setClassPK(classPK);
236            }
237    
238            /**
239            * Returns the key of this ticket.
240            *
241            * @return the key of this ticket
242            */
243            public java.lang.String getKey() {
244                    return _ticket.getKey();
245            }
246    
247            /**
248            * Sets the key of this ticket.
249            *
250            * @param key the key of this ticket
251            */
252            public void setKey(java.lang.String key) {
253                    _ticket.setKey(key);
254            }
255    
256            /**
257            * Returns the type of this ticket.
258            *
259            * @return the type of this ticket
260            */
261            public int getType() {
262                    return _ticket.getType();
263            }
264    
265            /**
266            * Sets the type of this ticket.
267            *
268            * @param type the type of this ticket
269            */
270            public void setType(int type) {
271                    _ticket.setType(type);
272            }
273    
274            /**
275            * Returns the extra info of this ticket.
276            *
277            * @return the extra info of this ticket
278            */
279            public java.lang.String getExtraInfo() {
280                    return _ticket.getExtraInfo();
281            }
282    
283            /**
284            * Sets the extra info of this ticket.
285            *
286            * @param extraInfo the extra info of this ticket
287            */
288            public void setExtraInfo(java.lang.String extraInfo) {
289                    _ticket.setExtraInfo(extraInfo);
290            }
291    
292            /**
293            * Returns the expiration date of this ticket.
294            *
295            * @return the expiration date of this ticket
296            */
297            public java.util.Date getExpirationDate() {
298                    return _ticket.getExpirationDate();
299            }
300    
301            /**
302            * Sets the expiration date of this ticket.
303            *
304            * @param expirationDate the expiration date of this ticket
305            */
306            public void setExpirationDate(java.util.Date expirationDate) {
307                    _ticket.setExpirationDate(expirationDate);
308            }
309    
310            public boolean isNew() {
311                    return _ticket.isNew();
312            }
313    
314            public void setNew(boolean n) {
315                    _ticket.setNew(n);
316            }
317    
318            public boolean isCachedModel() {
319                    return _ticket.isCachedModel();
320            }
321    
322            public void setCachedModel(boolean cachedModel) {
323                    _ticket.setCachedModel(cachedModel);
324            }
325    
326            public boolean isEscapedModel() {
327                    return _ticket.isEscapedModel();
328            }
329    
330            public java.io.Serializable getPrimaryKeyObj() {
331                    return _ticket.getPrimaryKeyObj();
332            }
333    
334            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
335                    _ticket.setPrimaryKeyObj(primaryKeyObj);
336            }
337    
338            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
339                    return _ticket.getExpandoBridge();
340            }
341    
342            public void setExpandoBridgeAttributes(
343                    com.liferay.portal.service.ServiceContext serviceContext) {
344                    _ticket.setExpandoBridgeAttributes(serviceContext);
345            }
346    
347            @Override
348            public java.lang.Object clone() {
349                    return new TicketWrapper((Ticket)_ticket.clone());
350            }
351    
352            public int compareTo(com.liferay.portal.model.Ticket ticket) {
353                    return _ticket.compareTo(ticket);
354            }
355    
356            @Override
357            public int hashCode() {
358                    return _ticket.hashCode();
359            }
360    
361            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Ticket> toCacheModel() {
362                    return _ticket.toCacheModel();
363            }
364    
365            public com.liferay.portal.model.Ticket toEscapedModel() {
366                    return new TicketWrapper(_ticket.toEscapedModel());
367            }
368    
369            public com.liferay.portal.model.Ticket toUnescapedModel() {
370                    return new TicketWrapper(_ticket.toUnescapedModel());
371            }
372    
373            @Override
374            public java.lang.String toString() {
375                    return _ticket.toString();
376            }
377    
378            public java.lang.String toXmlString() {
379                    return _ticket.toXmlString();
380            }
381    
382            public void persist()
383                    throws com.liferay.portal.kernel.exception.SystemException {
384                    _ticket.persist();
385            }
386    
387            public boolean isExpired() {
388                    return _ticket.isExpired();
389            }
390    
391            @Override
392            public boolean equals(Object obj) {
393                    if (this == obj) {
394                            return true;
395                    }
396    
397                    if (!(obj instanceof TicketWrapper)) {
398                            return false;
399                    }
400    
401                    TicketWrapper ticketWrapper = (TicketWrapper)obj;
402    
403                    if (Validator.equals(_ticket, ticketWrapper._ticket)) {
404                            return true;
405                    }
406    
407                    return false;
408            }
409    
410            /**
411             * @deprecated Renamed to {@link #getWrappedModel}
412             */
413            public Ticket getWrappedTicket() {
414                    return _ticket;
415            }
416    
417            public Ticket getWrappedModel() {
418                    return _ticket;
419            }
420    
421            public void resetOriginalValues() {
422                    _ticket.resetOriginalValues();
423            }
424    
425            private Ticket _ticket;
426    }