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.dynamicdatamapping.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.HashMap;
023    import java.util.Map;
024    
025    /**
026     * <p>
027     * This class is a wrapper for {@link DDMTemplateLink}.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see DDMTemplateLink
032     * @generated
033     */
034    @ProviderType
035    public class DDMTemplateLinkWrapper implements DDMTemplateLink,
036            ModelWrapper<DDMTemplateLink> {
037            public DDMTemplateLinkWrapper(DDMTemplateLink ddmTemplateLink) {
038                    _ddmTemplateLink = ddmTemplateLink;
039            }
040    
041            @Override
042            public Class<?> getModelClass() {
043                    return DDMTemplateLink.class;
044            }
045    
046            @Override
047            public String getModelClassName() {
048                    return DDMTemplateLink.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("templateLinkId", getTemplateLinkId());
056                    attributes.put("classNameId", getClassNameId());
057                    attributes.put("classPK", getClassPK());
058                    attributes.put("templateId", getTemplateId());
059    
060                    return attributes;
061            }
062    
063            @Override
064            public void setModelAttributes(Map<String, Object> attributes) {
065                    Long templateLinkId = (Long)attributes.get("templateLinkId");
066    
067                    if (templateLinkId != null) {
068                            setTemplateLinkId(templateLinkId);
069                    }
070    
071                    Long classNameId = (Long)attributes.get("classNameId");
072    
073                    if (classNameId != null) {
074                            setClassNameId(classNameId);
075                    }
076    
077                    Long classPK = (Long)attributes.get("classPK");
078    
079                    if (classPK != null) {
080                            setClassPK(classPK);
081                    }
082    
083                    Long templateId = (Long)attributes.get("templateId");
084    
085                    if (templateId != null) {
086                            setTemplateId(templateId);
087                    }
088            }
089    
090            @Override
091            public java.lang.Object clone() {
092                    return new DDMTemplateLinkWrapper((DDMTemplateLink)_ddmTemplateLink.clone());
093            }
094    
095            @Override
096            public int compareTo(
097                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplateLink ddmTemplateLink) {
098                    return _ddmTemplateLink.compareTo(ddmTemplateLink);
099            }
100    
101            /**
102            * Returns the fully qualified class name of this d d m template link.
103            *
104            * @return the fully qualified class name of this d d m template link
105            */
106            @Override
107            public java.lang.String getClassName() {
108                    return _ddmTemplateLink.getClassName();
109            }
110    
111            /**
112            * Returns the class name ID of this d d m template link.
113            *
114            * @return the class name ID of this d d m template link
115            */
116            @Override
117            public long getClassNameId() {
118                    return _ddmTemplateLink.getClassNameId();
119            }
120    
121            /**
122            * Returns the class p k of this d d m template link.
123            *
124            * @return the class p k of this d d m template link
125            */
126            @Override
127            public long getClassPK() {
128                    return _ddmTemplateLink.getClassPK();
129            }
130    
131            @Override
132            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
133                    return _ddmTemplateLink.getExpandoBridge();
134            }
135    
136            /**
137            * Returns the primary key of this d d m template link.
138            *
139            * @return the primary key of this d d m template link
140            */
141            @Override
142            public long getPrimaryKey() {
143                    return _ddmTemplateLink.getPrimaryKey();
144            }
145    
146            @Override
147            public java.io.Serializable getPrimaryKeyObj() {
148                    return _ddmTemplateLink.getPrimaryKeyObj();
149            }
150    
151            @Override
152            public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate()
153                    throws com.liferay.portal.kernel.exception.PortalException {
154                    return _ddmTemplateLink.getTemplate();
155            }
156    
157            /**
158            * Returns the template ID of this d d m template link.
159            *
160            * @return the template ID of this d d m template link
161            */
162            @Override
163            public long getTemplateId() {
164                    return _ddmTemplateLink.getTemplateId();
165            }
166    
167            /**
168            * Returns the template link ID of this d d m template link.
169            *
170            * @return the template link ID of this d d m template link
171            */
172            @Override
173            public long getTemplateLinkId() {
174                    return _ddmTemplateLink.getTemplateLinkId();
175            }
176    
177            @Override
178            public int hashCode() {
179                    return _ddmTemplateLink.hashCode();
180            }
181    
182            @Override
183            public boolean isCachedModel() {
184                    return _ddmTemplateLink.isCachedModel();
185            }
186    
187            @Override
188            public boolean isEscapedModel() {
189                    return _ddmTemplateLink.isEscapedModel();
190            }
191    
192            @Override
193            public boolean isNew() {
194                    return _ddmTemplateLink.isNew();
195            }
196    
197            @Override
198            public void persist() {
199                    _ddmTemplateLink.persist();
200            }
201    
202            @Override
203            public void setCachedModel(boolean cachedModel) {
204                    _ddmTemplateLink.setCachedModel(cachedModel);
205            }
206    
207            @Override
208            public void setClassName(java.lang.String className) {
209                    _ddmTemplateLink.setClassName(className);
210            }
211    
212            /**
213            * Sets the class name ID of this d d m template link.
214            *
215            * @param classNameId the class name ID of this d d m template link
216            */
217            @Override
218            public void setClassNameId(long classNameId) {
219                    _ddmTemplateLink.setClassNameId(classNameId);
220            }
221    
222            /**
223            * Sets the class p k of this d d m template link.
224            *
225            * @param classPK the class p k of this d d m template link
226            */
227            @Override
228            public void setClassPK(long classPK) {
229                    _ddmTemplateLink.setClassPK(classPK);
230            }
231    
232            @Override
233            public void setExpandoBridgeAttributes(
234                    com.liferay.portal.model.BaseModel<?> baseModel) {
235                    _ddmTemplateLink.setExpandoBridgeAttributes(baseModel);
236            }
237    
238            @Override
239            public void setExpandoBridgeAttributes(
240                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
241                    _ddmTemplateLink.setExpandoBridgeAttributes(expandoBridge);
242            }
243    
244            @Override
245            public void setExpandoBridgeAttributes(
246                    com.liferay.portal.service.ServiceContext serviceContext) {
247                    _ddmTemplateLink.setExpandoBridgeAttributes(serviceContext);
248            }
249    
250            @Override
251            public void setNew(boolean n) {
252                    _ddmTemplateLink.setNew(n);
253            }
254    
255            /**
256            * Sets the primary key of this d d m template link.
257            *
258            * @param primaryKey the primary key of this d d m template link
259            */
260            @Override
261            public void setPrimaryKey(long primaryKey) {
262                    _ddmTemplateLink.setPrimaryKey(primaryKey);
263            }
264    
265            @Override
266            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
267                    _ddmTemplateLink.setPrimaryKeyObj(primaryKeyObj);
268            }
269    
270            /**
271            * Sets the template ID of this d d m template link.
272            *
273            * @param templateId the template ID of this d d m template link
274            */
275            @Override
276            public void setTemplateId(long templateId) {
277                    _ddmTemplateLink.setTemplateId(templateId);
278            }
279    
280            /**
281            * Sets the template link ID of this d d m template link.
282            *
283            * @param templateLinkId the template link ID of this d d m template link
284            */
285            @Override
286            public void setTemplateLinkId(long templateLinkId) {
287                    _ddmTemplateLink.setTemplateLinkId(templateLinkId);
288            }
289    
290            @Override
291            public com.liferay.portal.model.CacheModel<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateLink> toCacheModel() {
292                    return _ddmTemplateLink.toCacheModel();
293            }
294    
295            @Override
296            public com.liferay.portlet.dynamicdatamapping.model.DDMTemplateLink toEscapedModel() {
297                    return new DDMTemplateLinkWrapper(_ddmTemplateLink.toEscapedModel());
298            }
299    
300            @Override
301            public java.lang.String toString() {
302                    return _ddmTemplateLink.toString();
303            }
304    
305            @Override
306            public com.liferay.portlet.dynamicdatamapping.model.DDMTemplateLink toUnescapedModel() {
307                    return new DDMTemplateLinkWrapper(_ddmTemplateLink.toUnescapedModel());
308            }
309    
310            @Override
311            public java.lang.String toXmlString() {
312                    return _ddmTemplateLink.toXmlString();
313            }
314    
315            @Override
316            public boolean equals(Object obj) {
317                    if (this == obj) {
318                            return true;
319                    }
320    
321                    if (!(obj instanceof DDMTemplateLinkWrapper)) {
322                            return false;
323                    }
324    
325                    DDMTemplateLinkWrapper ddmTemplateLinkWrapper = (DDMTemplateLinkWrapper)obj;
326    
327                    if (Validator.equals(_ddmTemplateLink,
328                                            ddmTemplateLinkWrapper._ddmTemplateLink)) {
329                            return true;
330                    }
331    
332                    return false;
333            }
334    
335            /**
336             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
337             */
338            @Deprecated
339            public DDMTemplateLink getWrappedDDMTemplateLink() {
340                    return _ddmTemplateLink;
341            }
342    
343            @Override
344            public DDMTemplateLink getWrappedModel() {
345                    return _ddmTemplateLink;
346            }
347    
348            @Override
349            public boolean isEntityCacheEnabled() {
350                    return _ddmTemplateLink.isEntityCacheEnabled();
351            }
352    
353            @Override
354            public boolean isFinderCacheEnabled() {
355                    return _ddmTemplateLink.isFinderCacheEnabled();
356            }
357    
358            @Override
359            public void resetOriginalValues() {
360                    _ddmTemplateLink.resetOriginalValues();
361            }
362    
363            private final DDMTemplateLink _ddmTemplateLink;
364    }