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