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