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