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