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.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.portal.kernel.service.ServiceContext;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    import java.util.HashMap;
027    import java.util.Map;
028    import java.util.Objects;
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 CacheModel<Ticket> toCacheModel() {
138                    return _ticket.toCacheModel();
139            }
140    
141            @Override
142            public Ticket toEscapedModel() {
143                    return new TicketWrapper(_ticket.toEscapedModel());
144            }
145    
146            @Override
147            public Ticket toUnescapedModel() {
148                    return new TicketWrapper(_ticket.toUnescapedModel());
149            }
150    
151            @Override
152            public boolean isCachedModel() {
153                    return _ticket.isCachedModel();
154            }
155    
156            @Override
157            public boolean isEscapedModel() {
158                    return _ticket.isEscapedModel();
159            }
160    
161            @Override
162            public boolean isExpired() {
163                    return _ticket.isExpired();
164            }
165    
166            @Override
167            public boolean isNew() {
168                    return _ticket.isNew();
169            }
170    
171            @Override
172            public ExpandoBridge getExpandoBridge() {
173                    return _ticket.getExpandoBridge();
174            }
175    
176            @Override
177            public int compareTo(Ticket ticket) {
178                    return _ticket.compareTo(ticket);
179            }
180    
181            /**
182            * Returns the type of this ticket.
183            *
184            * @return the type of this ticket
185            */
186            @Override
187            public int getType() {
188                    return _ticket.getType();
189            }
190    
191            @Override
192            public int hashCode() {
193                    return _ticket.hashCode();
194            }
195    
196            @Override
197            public Serializable getPrimaryKeyObj() {
198                    return _ticket.getPrimaryKeyObj();
199            }
200    
201            @Override
202            public java.lang.Object clone() {
203                    return new TicketWrapper((Ticket)_ticket.clone());
204            }
205    
206            /**
207            * Returns the fully qualified class name of this ticket.
208            *
209            * @return the fully qualified class name of this ticket
210            */
211            @Override
212            public java.lang.String getClassName() {
213                    return _ticket.getClassName();
214            }
215    
216            /**
217            * Returns the extra info of this ticket.
218            *
219            * @return the extra info of this ticket
220            */
221            @Override
222            public java.lang.String getExtraInfo() {
223                    return _ticket.getExtraInfo();
224            }
225    
226            /**
227            * Returns the key of this ticket.
228            *
229            * @return the key of this ticket
230            */
231            @Override
232            public java.lang.String getKey() {
233                    return _ticket.getKey();
234            }
235    
236            @Override
237            public java.lang.String toString() {
238                    return _ticket.toString();
239            }
240    
241            @Override
242            public java.lang.String toXmlString() {
243                    return _ticket.toXmlString();
244            }
245    
246            /**
247            * Returns the create date of this ticket.
248            *
249            * @return the create date of this ticket
250            */
251            @Override
252            public Date getCreateDate() {
253                    return _ticket.getCreateDate();
254            }
255    
256            /**
257            * Returns the expiration date of this ticket.
258            *
259            * @return the expiration date of this ticket
260            */
261            @Override
262            public Date getExpirationDate() {
263                    return _ticket.getExpirationDate();
264            }
265    
266            /**
267            * Returns the class name ID of this ticket.
268            *
269            * @return the class name ID of this ticket
270            */
271            @Override
272            public long getClassNameId() {
273                    return _ticket.getClassNameId();
274            }
275    
276            /**
277            * Returns the class p k of this ticket.
278            *
279            * @return the class p k of this ticket
280            */
281            @Override
282            public long getClassPK() {
283                    return _ticket.getClassPK();
284            }
285    
286            /**
287            * Returns the company ID of this ticket.
288            *
289            * @return the company ID of this ticket
290            */
291            @Override
292            public long getCompanyId() {
293                    return _ticket.getCompanyId();
294            }
295    
296            /**
297            * Returns the mvcc version of this ticket.
298            *
299            * @return the mvcc version of this ticket
300            */
301            @Override
302            public long getMvccVersion() {
303                    return _ticket.getMvccVersion();
304            }
305    
306            /**
307            * Returns the primary key of this ticket.
308            *
309            * @return the primary key of this ticket
310            */
311            @Override
312            public long getPrimaryKey() {
313                    return _ticket.getPrimaryKey();
314            }
315    
316            /**
317            * Returns the ticket ID of this ticket.
318            *
319            * @return the ticket ID of this ticket
320            */
321            @Override
322            public long getTicketId() {
323                    return _ticket.getTicketId();
324            }
325    
326            @Override
327            public void persist() {
328                    _ticket.persist();
329            }
330    
331            @Override
332            public void setCachedModel(boolean cachedModel) {
333                    _ticket.setCachedModel(cachedModel);
334            }
335    
336            @Override
337            public void setClassName(java.lang.String className) {
338                    _ticket.setClassName(className);
339            }
340    
341            /**
342            * Sets the class name ID of this ticket.
343            *
344            * @param classNameId the class name ID of this ticket
345            */
346            @Override
347            public void setClassNameId(long classNameId) {
348                    _ticket.setClassNameId(classNameId);
349            }
350    
351            /**
352            * Sets the class p k of this ticket.
353            *
354            * @param classPK the class p k of this ticket
355            */
356            @Override
357            public void setClassPK(long classPK) {
358                    _ticket.setClassPK(classPK);
359            }
360    
361            /**
362            * Sets the company ID of this ticket.
363            *
364            * @param companyId the company ID of this ticket
365            */
366            @Override
367            public void setCompanyId(long companyId) {
368                    _ticket.setCompanyId(companyId);
369            }
370    
371            /**
372            * Sets the create date of this ticket.
373            *
374            * @param createDate the create date of this ticket
375            */
376            @Override
377            public void setCreateDate(Date createDate) {
378                    _ticket.setCreateDate(createDate);
379            }
380    
381            @Override
382            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
383                    _ticket.setExpandoBridgeAttributes(baseModel);
384            }
385    
386            @Override
387            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
388                    _ticket.setExpandoBridgeAttributes(expandoBridge);
389            }
390    
391            @Override
392            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
393                    _ticket.setExpandoBridgeAttributes(serviceContext);
394            }
395    
396            /**
397            * Sets the expiration date of this ticket.
398            *
399            * @param expirationDate the expiration date of this ticket
400            */
401            @Override
402            public void setExpirationDate(Date expirationDate) {
403                    _ticket.setExpirationDate(expirationDate);
404            }
405    
406            /**
407            * Sets the extra info of this ticket.
408            *
409            * @param extraInfo the extra info of this ticket
410            */
411            @Override
412            public void setExtraInfo(java.lang.String extraInfo) {
413                    _ticket.setExtraInfo(extraInfo);
414            }
415    
416            /**
417            * Sets the key of this ticket.
418            *
419            * @param key the key of this ticket
420            */
421            @Override
422            public void setKey(java.lang.String key) {
423                    _ticket.setKey(key);
424            }
425    
426            /**
427            * Sets the mvcc version of this ticket.
428            *
429            * @param mvccVersion the mvcc version of this ticket
430            */
431            @Override
432            public void setMvccVersion(long mvccVersion) {
433                    _ticket.setMvccVersion(mvccVersion);
434            }
435    
436            @Override
437            public void setNew(boolean n) {
438                    _ticket.setNew(n);
439            }
440    
441            /**
442            * Sets the primary key of this ticket.
443            *
444            * @param primaryKey the primary key of this ticket
445            */
446            @Override
447            public void setPrimaryKey(long primaryKey) {
448                    _ticket.setPrimaryKey(primaryKey);
449            }
450    
451            @Override
452            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
453                    _ticket.setPrimaryKeyObj(primaryKeyObj);
454            }
455    
456            /**
457            * Sets the ticket ID of this ticket.
458            *
459            * @param ticketId the ticket ID of this ticket
460            */
461            @Override
462            public void setTicketId(long ticketId) {
463                    _ticket.setTicketId(ticketId);
464            }
465    
466            /**
467            * Sets the type of this ticket.
468            *
469            * @param type the type of this ticket
470            */
471            @Override
472            public void setType(int type) {
473                    _ticket.setType(type);
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 (Objects.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    }