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