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 Lock}.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see Lock
032     * @generated
033     */
034    @ProviderType
035    public class LockWrapper implements Lock, ModelWrapper<Lock> {
036            public LockWrapper(Lock lock) {
037                    _lock = lock;
038            }
039    
040            @Override
041            public Class<?> getModelClass() {
042                    return Lock.class;
043            }
044    
045            @Override
046            public String getModelClassName() {
047                    return Lock.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("uuid", getUuid());
056                    attributes.put("lockId", getLockId());
057                    attributes.put("companyId", getCompanyId());
058                    attributes.put("userId", getUserId());
059                    attributes.put("userName", getUserName());
060                    attributes.put("createDate", getCreateDate());
061                    attributes.put("className", getClassName());
062                    attributes.put("key", getKey());
063                    attributes.put("owner", getOwner());
064                    attributes.put("inheritable", getInheritable());
065                    attributes.put("expirationDate", getExpirationDate());
066    
067                    return attributes;
068            }
069    
070            @Override
071            public void setModelAttributes(Map<String, Object> attributes) {
072                    Long mvccVersion = (Long)attributes.get("mvccVersion");
073    
074                    if (mvccVersion != null) {
075                            setMvccVersion(mvccVersion);
076                    }
077    
078                    String uuid = (String)attributes.get("uuid");
079    
080                    if (uuid != null) {
081                            setUuid(uuid);
082                    }
083    
084                    Long lockId = (Long)attributes.get("lockId");
085    
086                    if (lockId != null) {
087                            setLockId(lockId);
088                    }
089    
090                    Long companyId = (Long)attributes.get("companyId");
091    
092                    if (companyId != null) {
093                            setCompanyId(companyId);
094                    }
095    
096                    Long userId = (Long)attributes.get("userId");
097    
098                    if (userId != null) {
099                            setUserId(userId);
100                    }
101    
102                    String userName = (String)attributes.get("userName");
103    
104                    if (userName != null) {
105                            setUserName(userName);
106                    }
107    
108                    Date createDate = (Date)attributes.get("createDate");
109    
110                    if (createDate != null) {
111                            setCreateDate(createDate);
112                    }
113    
114                    String className = (String)attributes.get("className");
115    
116                    if (className != null) {
117                            setClassName(className);
118                    }
119    
120                    String key = (String)attributes.get("key");
121    
122                    if (key != null) {
123                            setKey(key);
124                    }
125    
126                    String owner = (String)attributes.get("owner");
127    
128                    if (owner != null) {
129                            setOwner(owner);
130                    }
131    
132                    Boolean inheritable = (Boolean)attributes.get("inheritable");
133    
134                    if (inheritable != null) {
135                            setInheritable(inheritable);
136                    }
137    
138                    Date expirationDate = (Date)attributes.get("expirationDate");
139    
140                    if (expirationDate != null) {
141                            setExpirationDate(expirationDate);
142                    }
143            }
144    
145            @Override
146            public java.lang.Object clone() {
147                    return new LockWrapper((Lock)_lock.clone());
148            }
149    
150            @Override
151            public int compareTo(com.liferay.portal.model.Lock lock) {
152                    return _lock.compareTo(lock);
153            }
154    
155            /**
156            * Returns the class name of this lock.
157            *
158            * @return the class name of this lock
159            */
160            @Override
161            public java.lang.String getClassName() {
162                    return _lock.getClassName();
163            }
164    
165            /**
166            * Returns the company ID of this lock.
167            *
168            * @return the company ID of this lock
169            */
170            @Override
171            public long getCompanyId() {
172                    return _lock.getCompanyId();
173            }
174    
175            /**
176            * Returns the create date of this lock.
177            *
178            * @return the create date of this lock
179            */
180            @Override
181            public java.util.Date getCreateDate() {
182                    return _lock.getCreateDate();
183            }
184    
185            @Override
186            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
187                    return _lock.getExpandoBridge();
188            }
189    
190            /**
191            * Returns the expiration date of this lock.
192            *
193            * @return the expiration date of this lock
194            */
195            @Override
196            public java.util.Date getExpirationDate() {
197                    return _lock.getExpirationDate();
198            }
199    
200            @Override
201            public long getExpirationTime() {
202                    return _lock.getExpirationTime();
203            }
204    
205            /**
206            * Returns the inheritable of this lock.
207            *
208            * @return the inheritable of this lock
209            */
210            @Override
211            public boolean getInheritable() {
212                    return _lock.getInheritable();
213            }
214    
215            /**
216            * Returns the key of this lock.
217            *
218            * @return the key of this lock
219            */
220            @Override
221            public java.lang.String getKey() {
222                    return _lock.getKey();
223            }
224    
225            /**
226            * Returns the lock ID of this lock.
227            *
228            * @return the lock ID of this lock
229            */
230            @Override
231            public long getLockId() {
232                    return _lock.getLockId();
233            }
234    
235            /**
236            * Returns the mvcc version of this lock.
237            *
238            * @return the mvcc version of this lock
239            */
240            @Override
241            public long getMvccVersion() {
242                    return _lock.getMvccVersion();
243            }
244    
245            /**
246            * Returns the owner of this lock.
247            *
248            * @return the owner of this lock
249            */
250            @Override
251            public java.lang.String getOwner() {
252                    return _lock.getOwner();
253            }
254    
255            /**
256            * Returns the primary key of this lock.
257            *
258            * @return the primary key of this lock
259            */
260            @Override
261            public long getPrimaryKey() {
262                    return _lock.getPrimaryKey();
263            }
264    
265            @Override
266            public java.io.Serializable getPrimaryKeyObj() {
267                    return _lock.getPrimaryKeyObj();
268            }
269    
270            /**
271            * Returns the user ID of this lock.
272            *
273            * @return the user ID of this lock
274            */
275            @Override
276            public long getUserId() {
277                    return _lock.getUserId();
278            }
279    
280            /**
281            * Returns the user name of this lock.
282            *
283            * @return the user name of this lock
284            */
285            @Override
286            public java.lang.String getUserName() {
287                    return _lock.getUserName();
288            }
289    
290            /**
291            * Returns the user uuid of this lock.
292            *
293            * @return the user uuid of this lock
294            */
295            @Override
296            public java.lang.String getUserUuid() {
297                    return _lock.getUserUuid();
298            }
299    
300            /**
301            * Returns the uuid of this lock.
302            *
303            * @return the uuid of this lock
304            */
305            @Override
306            public java.lang.String getUuid() {
307                    return _lock.getUuid();
308            }
309    
310            @Override
311            public int hashCode() {
312                    return _lock.hashCode();
313            }
314    
315            @Override
316            public boolean isCachedModel() {
317                    return _lock.isCachedModel();
318            }
319    
320            @Override
321            public boolean isEscapedModel() {
322                    return _lock.isEscapedModel();
323            }
324    
325            @Override
326            public boolean isExpired() {
327                    return _lock.isExpired();
328            }
329    
330            /**
331            * Returns <code>true</code> if this lock is inheritable.
332            *
333            * @return <code>true</code> if this lock is inheritable; <code>false</code> otherwise
334            */
335            @Override
336            public boolean isInheritable() {
337                    return _lock.isInheritable();
338            }
339    
340            @Override
341            public boolean isNeverExpires() {
342                    return _lock.isNeverExpires();
343            }
344    
345            @Override
346            public boolean isNew() {
347                    return _lock.isNew();
348            }
349    
350            @Override
351            public void persist() {
352                    _lock.persist();
353            }
354    
355            @Override
356            public void setCachedModel(boolean cachedModel) {
357                    _lock.setCachedModel(cachedModel);
358            }
359    
360            /**
361            * Sets the class name of this lock.
362            *
363            * @param className the class name of this lock
364            */
365            @Override
366            public void setClassName(java.lang.String className) {
367                    _lock.setClassName(className);
368            }
369    
370            /**
371            * Sets the company ID of this lock.
372            *
373            * @param companyId the company ID of this lock
374            */
375            @Override
376            public void setCompanyId(long companyId) {
377                    _lock.setCompanyId(companyId);
378            }
379    
380            /**
381            * Sets the create date of this lock.
382            *
383            * @param createDate the create date of this lock
384            */
385            @Override
386            public void setCreateDate(java.util.Date createDate) {
387                    _lock.setCreateDate(createDate);
388            }
389    
390            @Override
391            public void setExpandoBridgeAttributes(
392                    com.liferay.portal.model.BaseModel<?> baseModel) {
393                    _lock.setExpandoBridgeAttributes(baseModel);
394            }
395    
396            @Override
397            public void setExpandoBridgeAttributes(
398                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
399                    _lock.setExpandoBridgeAttributes(expandoBridge);
400            }
401    
402            @Override
403            public void setExpandoBridgeAttributes(
404                    com.liferay.portal.service.ServiceContext serviceContext) {
405                    _lock.setExpandoBridgeAttributes(serviceContext);
406            }
407    
408            /**
409            * Sets the expiration date of this lock.
410            *
411            * @param expirationDate the expiration date of this lock
412            */
413            @Override
414            public void setExpirationDate(java.util.Date expirationDate) {
415                    _lock.setExpirationDate(expirationDate);
416            }
417    
418            /**
419            * Sets whether this lock is inheritable.
420            *
421            * @param inheritable the inheritable of this lock
422            */
423            @Override
424            public void setInheritable(boolean inheritable) {
425                    _lock.setInheritable(inheritable);
426            }
427    
428            /**
429            * Sets the key of this lock.
430            *
431            * @param key the key of this lock
432            */
433            @Override
434            public void setKey(java.lang.String key) {
435                    _lock.setKey(key);
436            }
437    
438            /**
439            * Sets the lock ID of this lock.
440            *
441            * @param lockId the lock ID of this lock
442            */
443            @Override
444            public void setLockId(long lockId) {
445                    _lock.setLockId(lockId);
446            }
447    
448            /**
449            * Sets the mvcc version of this lock.
450            *
451            * @param mvccVersion the mvcc version of this lock
452            */
453            @Override
454            public void setMvccVersion(long mvccVersion) {
455                    _lock.setMvccVersion(mvccVersion);
456            }
457    
458            @Override
459            public void setNew(boolean n) {
460                    _lock.setNew(n);
461            }
462    
463            /**
464            * Sets the owner of this lock.
465            *
466            * @param owner the owner of this lock
467            */
468            @Override
469            public void setOwner(java.lang.String owner) {
470                    _lock.setOwner(owner);
471            }
472    
473            /**
474            * Sets the primary key of this lock.
475            *
476            * @param primaryKey the primary key of this lock
477            */
478            @Override
479            public void setPrimaryKey(long primaryKey) {
480                    _lock.setPrimaryKey(primaryKey);
481            }
482    
483            @Override
484            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
485                    _lock.setPrimaryKeyObj(primaryKeyObj);
486            }
487    
488            /**
489            * Sets the user ID of this lock.
490            *
491            * @param userId the user ID of this lock
492            */
493            @Override
494            public void setUserId(long userId) {
495                    _lock.setUserId(userId);
496            }
497    
498            /**
499            * Sets the user name of this lock.
500            *
501            * @param userName the user name of this lock
502            */
503            @Override
504            public void setUserName(java.lang.String userName) {
505                    _lock.setUserName(userName);
506            }
507    
508            /**
509            * Sets the user uuid of this lock.
510            *
511            * @param userUuid the user uuid of this lock
512            */
513            @Override
514            public void setUserUuid(java.lang.String userUuid) {
515                    _lock.setUserUuid(userUuid);
516            }
517    
518            /**
519            * Sets the uuid of this lock.
520            *
521            * @param uuid the uuid of this lock
522            */
523            @Override
524            public void setUuid(java.lang.String uuid) {
525                    _lock.setUuid(uuid);
526            }
527    
528            @Override
529            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Lock> toCacheModel() {
530                    return _lock.toCacheModel();
531            }
532    
533            @Override
534            public com.liferay.portal.model.Lock toEscapedModel() {
535                    return new LockWrapper(_lock.toEscapedModel());
536            }
537    
538            @Override
539            public java.lang.String toString() {
540                    return _lock.toString();
541            }
542    
543            @Override
544            public com.liferay.portal.model.Lock toUnescapedModel() {
545                    return new LockWrapper(_lock.toUnescapedModel());
546            }
547    
548            @Override
549            public java.lang.String toXmlString() {
550                    return _lock.toXmlString();
551            }
552    
553            @Override
554            public boolean equals(Object obj) {
555                    if (this == obj) {
556                            return true;
557                    }
558    
559                    if (!(obj instanceof LockWrapper)) {
560                            return false;
561                    }
562    
563                    LockWrapper lockWrapper = (LockWrapper)obj;
564    
565                    if (Validator.equals(_lock, lockWrapper._lock)) {
566                            return true;
567                    }
568    
569                    return false;
570            }
571    
572            /**
573             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
574             */
575            @Deprecated
576            public Lock getWrappedLock() {
577                    return _lock;
578            }
579    
580            @Override
581            public Lock getWrappedModel() {
582                    return _lock;
583            }
584    
585            @Override
586            public boolean isEntityCacheEnabled() {
587                    return _lock.isEntityCacheEnabled();
588            }
589    
590            @Override
591            public boolean isFinderCacheEnabled() {
592                    return _lock.isFinderCacheEnabled();
593            }
594    
595            @Override
596            public void resetOriginalValues() {
597                    _lock.resetOriginalValues();
598            }
599    
600            private final Lock _lock;
601    }