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