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