001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.model;
016    
017    import java.util.HashMap;
018    import java.util.Map;
019    
020    /**
021     * <p>
022     * This class is a wrapper for {@link Resource}.
023     * </p>
024     *
025     * @author    Brian Wing Shun Chan
026     * @see       Resource
027     * @generated
028     */
029    public class ResourceWrapper implements Resource, ModelWrapper<Resource> {
030            public ResourceWrapper(Resource resource) {
031                    _resource = resource;
032            }
033    
034            public Class<?> getModelClass() {
035                    return Resource.class;
036            }
037    
038            public String getModelClassName() {
039                    return Resource.class.getName();
040            }
041    
042            public Map<String, Object> getModelAttributes() {
043                    Map<String, Object> attributes = new HashMap<String, Object>();
044    
045                    attributes.put("resourceId", getResourceId());
046                    attributes.put("codeId", getCodeId());
047                    attributes.put("primKey", getPrimKey());
048    
049                    return attributes;
050            }
051    
052            public void setModelAttributes(Map<String, Object> attributes) {
053                    Long resourceId = (Long)attributes.get("resourceId");
054    
055                    if (resourceId != null) {
056                            setResourceId(resourceId);
057                    }
058    
059                    Long codeId = (Long)attributes.get("codeId");
060    
061                    if (codeId != null) {
062                            setCodeId(codeId);
063                    }
064    
065                    String primKey = (String)attributes.get("primKey");
066    
067                    if (primKey != null) {
068                            setPrimKey(primKey);
069                    }
070            }
071    
072            /**
073            * Returns the primary key of this resource.
074            *
075            * @return the primary key of this resource
076            */
077            public long getPrimaryKey() {
078                    return _resource.getPrimaryKey();
079            }
080    
081            /**
082            * Sets the primary key of this resource.
083            *
084            * @param primaryKey the primary key of this resource
085            */
086            public void setPrimaryKey(long primaryKey) {
087                    _resource.setPrimaryKey(primaryKey);
088            }
089    
090            /**
091            * Returns the resource ID of this resource.
092            *
093            * @return the resource ID of this resource
094            */
095            public long getResourceId() {
096                    return _resource.getResourceId();
097            }
098    
099            /**
100            * Sets the resource ID of this resource.
101            *
102            * @param resourceId the resource ID of this resource
103            */
104            public void setResourceId(long resourceId) {
105                    _resource.setResourceId(resourceId);
106            }
107    
108            /**
109            * Returns the code ID of this resource.
110            *
111            * @return the code ID of this resource
112            */
113            public long getCodeId() {
114                    return _resource.getCodeId();
115            }
116    
117            /**
118            * Sets the code ID of this resource.
119            *
120            * @param codeId the code ID of this resource
121            */
122            public void setCodeId(long codeId) {
123                    _resource.setCodeId(codeId);
124            }
125    
126            /**
127            * Returns the prim key of this resource.
128            *
129            * @return the prim key of this resource
130            */
131            public java.lang.String getPrimKey() {
132                    return _resource.getPrimKey();
133            }
134    
135            /**
136            * Sets the prim key of this resource.
137            *
138            * @param primKey the prim key of this resource
139            */
140            public void setPrimKey(java.lang.String primKey) {
141                    _resource.setPrimKey(primKey);
142            }
143    
144            public boolean isNew() {
145                    return _resource.isNew();
146            }
147    
148            public void setNew(boolean n) {
149                    _resource.setNew(n);
150            }
151    
152            public boolean isCachedModel() {
153                    return _resource.isCachedModel();
154            }
155    
156            public void setCachedModel(boolean cachedModel) {
157                    _resource.setCachedModel(cachedModel);
158            }
159    
160            public boolean isEscapedModel() {
161                    return _resource.isEscapedModel();
162            }
163    
164            public java.io.Serializable getPrimaryKeyObj() {
165                    return _resource.getPrimaryKeyObj();
166            }
167    
168            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
169                    _resource.setPrimaryKeyObj(primaryKeyObj);
170            }
171    
172            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
173                    return _resource.getExpandoBridge();
174            }
175    
176            public void setExpandoBridgeAttributes(
177                    com.liferay.portal.service.ServiceContext serviceContext) {
178                    _resource.setExpandoBridgeAttributes(serviceContext);
179            }
180    
181            @Override
182            public java.lang.Object clone() {
183                    return new ResourceWrapper((Resource)_resource.clone());
184            }
185    
186            public int compareTo(com.liferay.portal.model.Resource resource) {
187                    return _resource.compareTo(resource);
188            }
189    
190            @Override
191            public int hashCode() {
192                    return _resource.hashCode();
193            }
194    
195            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Resource> toCacheModel() {
196                    return _resource.toCacheModel();
197            }
198    
199            public com.liferay.portal.model.Resource toEscapedModel() {
200                    return new ResourceWrapper(_resource.toEscapedModel());
201            }
202    
203            @Override
204            public java.lang.String toString() {
205                    return _resource.toString();
206            }
207    
208            public java.lang.String toXmlString() {
209                    return _resource.toXmlString();
210            }
211    
212            public void persist()
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    _resource.persist();
215            }
216    
217            public long getCompanyId()
218                    throws com.liferay.portal.kernel.exception.PortalException,
219                            com.liferay.portal.kernel.exception.SystemException {
220                    return _resource.getCompanyId();
221            }
222    
223            public java.lang.String getName()
224                    throws com.liferay.portal.kernel.exception.PortalException,
225                            com.liferay.portal.kernel.exception.SystemException {
226                    return _resource.getName();
227            }
228    
229            public int getScope()
230                    throws com.liferay.portal.kernel.exception.PortalException,
231                            com.liferay.portal.kernel.exception.SystemException {
232                    return _resource.getScope();
233            }
234    
235            public void setCompanyId(long companyId) {
236                    _resource.setCompanyId(companyId);
237            }
238    
239            public void setName(java.lang.String name) {
240                    _resource.setName(name);
241            }
242    
243            public void setScope(int scope) {
244                    _resource.setScope(scope);
245            }
246    
247            /**
248             * @deprecated Renamed to {@link #getWrappedModel}
249             */
250            public Resource getWrappedResource() {
251                    return _resource;
252            }
253    
254            public Resource getWrappedModel() {
255                    return _resource;
256            }
257    
258            public void resetOriginalValues() {
259                    _resource.resetOriginalValues();
260            }
261    
262            private Resource _resource;
263    }