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