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