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