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