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