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