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.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            @Override
126            public java.lang.Object clone() {
127                    return new AssetLinkWrapper((AssetLink)_assetLink.clone());
128            }
129    
130            @Override
131            public int compareTo(com.liferay.portlet.asset.model.AssetLink assetLink) {
132                    return _assetLink.compareTo(assetLink);
133            }
134    
135            /**
136            * Returns the company ID of this asset link.
137            *
138            * @return the company ID of this asset link
139            */
140            @Override
141            public long getCompanyId() {
142                    return _assetLink.getCompanyId();
143            }
144    
145            /**
146            * Returns the create date of this asset link.
147            *
148            * @return the create date of this asset link
149            */
150            @Override
151            public Date getCreateDate() {
152                    return _assetLink.getCreateDate();
153            }
154    
155            /**
156            * Returns the entry id1 of this asset link.
157            *
158            * @return the entry id1 of this asset link
159            */
160            @Override
161            public long getEntryId1() {
162                    return _assetLink.getEntryId1();
163            }
164    
165            /**
166            * Returns the entry id2 of this asset link.
167            *
168            * @return the entry id2 of this asset link
169            */
170            @Override
171            public long getEntryId2() {
172                    return _assetLink.getEntryId2();
173            }
174    
175            @Override
176            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
177                    return _assetLink.getExpandoBridge();
178            }
179    
180            /**
181            * Returns the link ID of this asset link.
182            *
183            * @return the link ID of this asset link
184            */
185            @Override
186            public long getLinkId() {
187                    return _assetLink.getLinkId();
188            }
189    
190            /**
191            * Returns the primary key of this asset link.
192            *
193            * @return the primary key of this asset link
194            */
195            @Override
196            public long getPrimaryKey() {
197                    return _assetLink.getPrimaryKey();
198            }
199    
200            @Override
201            public java.io.Serializable getPrimaryKeyObj() {
202                    return _assetLink.getPrimaryKeyObj();
203            }
204    
205            /**
206            * Returns the type of this asset link.
207            *
208            * @return the type of this asset link
209            */
210            @Override
211            public int getType() {
212                    return _assetLink.getType();
213            }
214    
215            /**
216            * Returns the user ID of this asset link.
217            *
218            * @return the user ID of this asset link
219            */
220            @Override
221            public long getUserId() {
222                    return _assetLink.getUserId();
223            }
224    
225            /**
226            * Returns the user name of this asset link.
227            *
228            * @return the user name of this asset link
229            */
230            @Override
231            public java.lang.String getUserName() {
232                    return _assetLink.getUserName();
233            }
234    
235            /**
236            * Returns the user uuid of this asset link.
237            *
238            * @return the user uuid of this asset link
239            */
240            @Override
241            public java.lang.String getUserUuid() {
242                    return _assetLink.getUserUuid();
243            }
244    
245            /**
246            * Returns the weight of this asset link.
247            *
248            * @return the weight of this asset link
249            */
250            @Override
251            public int getWeight() {
252                    return _assetLink.getWeight();
253            }
254    
255            @Override
256            public int hashCode() {
257                    return _assetLink.hashCode();
258            }
259    
260            @Override
261            public boolean isCachedModel() {
262                    return _assetLink.isCachedModel();
263            }
264    
265            @Override
266            public boolean isEscapedModel() {
267                    return _assetLink.isEscapedModel();
268            }
269    
270            @Override
271            public boolean isNew() {
272                    return _assetLink.isNew();
273            }
274    
275            @Override
276            public void persist() {
277                    _assetLink.persist();
278            }
279    
280            @Override
281            public void setCachedModel(boolean cachedModel) {
282                    _assetLink.setCachedModel(cachedModel);
283            }
284    
285            /**
286            * Sets the company ID of this asset link.
287            *
288            * @param companyId the company ID of this asset link
289            */
290            @Override
291            public void setCompanyId(long companyId) {
292                    _assetLink.setCompanyId(companyId);
293            }
294    
295            /**
296            * Sets the create date of this asset link.
297            *
298            * @param createDate the create date of this asset link
299            */
300            @Override
301            public void setCreateDate(Date createDate) {
302                    _assetLink.setCreateDate(createDate);
303            }
304    
305            /**
306            * Sets the entry id1 of this asset link.
307            *
308            * @param entryId1 the entry id1 of this asset link
309            */
310            @Override
311            public void setEntryId1(long entryId1) {
312                    _assetLink.setEntryId1(entryId1);
313            }
314    
315            /**
316            * Sets the entry id2 of this asset link.
317            *
318            * @param entryId2 the entry id2 of this asset link
319            */
320            @Override
321            public void setEntryId2(long entryId2) {
322                    _assetLink.setEntryId2(entryId2);
323            }
324    
325            @Override
326            public void setExpandoBridgeAttributes(
327                    com.liferay.portal.model.BaseModel<?> baseModel) {
328                    _assetLink.setExpandoBridgeAttributes(baseModel);
329            }
330    
331            @Override
332            public void setExpandoBridgeAttributes(
333                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
334                    _assetLink.setExpandoBridgeAttributes(expandoBridge);
335            }
336    
337            @Override
338            public void setExpandoBridgeAttributes(
339                    com.liferay.portal.service.ServiceContext serviceContext) {
340                    _assetLink.setExpandoBridgeAttributes(serviceContext);
341            }
342    
343            /**
344            * Sets the link ID of this asset link.
345            *
346            * @param linkId the link ID of this asset link
347            */
348            @Override
349            public void setLinkId(long linkId) {
350                    _assetLink.setLinkId(linkId);
351            }
352    
353            @Override
354            public void setNew(boolean n) {
355                    _assetLink.setNew(n);
356            }
357    
358            /**
359            * Sets the primary key of this asset link.
360            *
361            * @param primaryKey the primary key of this asset link
362            */
363            @Override
364            public void setPrimaryKey(long primaryKey) {
365                    _assetLink.setPrimaryKey(primaryKey);
366            }
367    
368            @Override
369            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
370                    _assetLink.setPrimaryKeyObj(primaryKeyObj);
371            }
372    
373            /**
374            * Sets the type of this asset link.
375            *
376            * @param type the type of this asset link
377            */
378            @Override
379            public void setType(int type) {
380                    _assetLink.setType(type);
381            }
382    
383            /**
384            * Sets the user ID of this asset link.
385            *
386            * @param userId the user ID of this asset link
387            */
388            @Override
389            public void setUserId(long userId) {
390                    _assetLink.setUserId(userId);
391            }
392    
393            /**
394            * Sets the user name of this asset link.
395            *
396            * @param userName the user name of this asset link
397            */
398            @Override
399            public void setUserName(java.lang.String userName) {
400                    _assetLink.setUserName(userName);
401            }
402    
403            /**
404            * Sets the user uuid of this asset link.
405            *
406            * @param userUuid the user uuid of this asset link
407            */
408            @Override
409            public void setUserUuid(java.lang.String userUuid) {
410                    _assetLink.setUserUuid(userUuid);
411            }
412    
413            /**
414            * Sets the weight of this asset link.
415            *
416            * @param weight the weight of this asset link
417            */
418            @Override
419            public void setWeight(int weight) {
420                    _assetLink.setWeight(weight);
421            }
422    
423            @Override
424            public com.liferay.portal.model.CacheModel<com.liferay.portlet.asset.model.AssetLink> toCacheModel() {
425                    return _assetLink.toCacheModel();
426            }
427    
428            @Override
429            public com.liferay.portlet.asset.model.AssetLink toEscapedModel() {
430                    return new AssetLinkWrapper(_assetLink.toEscapedModel());
431            }
432    
433            @Override
434            public java.lang.String toString() {
435                    return _assetLink.toString();
436            }
437    
438            @Override
439            public com.liferay.portlet.asset.model.AssetLink toUnescapedModel() {
440                    return new AssetLinkWrapper(_assetLink.toUnescapedModel());
441            }
442    
443            @Override
444            public java.lang.String toXmlString() {
445                    return _assetLink.toXmlString();
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            @Override
468            public AssetLink getWrappedModel() {
469                    return _assetLink;
470            }
471    
472            @Override
473            public boolean isEntityCacheEnabled() {
474                    return _assetLink.isEntityCacheEnabled();
475            }
476    
477            @Override
478            public boolean isFinderCacheEnabled() {
479                    return _assetLink.isFinderCacheEnabled();
480            }
481    
482            @Override
483            public void resetOriginalValues() {
484                    _assetLink.resetOriginalValues();
485            }
486    
487            private final AssetLink _assetLink;
488    }