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