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