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