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