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