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(
249                    com.liferay.portal.model.BaseModel<?> baseModel) {
250                    _region.setExpandoBridgeAttributes(baseModel);
251            }
252    
253            @Override
254            public void setExpandoBridgeAttributes(
255                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
256                    _region.setExpandoBridgeAttributes(expandoBridge);
257            }
258    
259            @Override
260            public void setExpandoBridgeAttributes(
261                    com.liferay.portal.service.ServiceContext serviceContext) {
262                    _region.setExpandoBridgeAttributes(serviceContext);
263            }
264    
265            /**
266            * Sets the mvcc version of this region.
267            *
268            * @param mvccVersion the mvcc version of this region
269            */
270            @Override
271            public void setMvccVersion(long mvccVersion) {
272                    _region.setMvccVersion(mvccVersion);
273            }
274    
275            /**
276            * Sets the name of this region.
277            *
278            * @param name the name of this region
279            */
280            @Override
281            public void setName(java.lang.String name) {
282                    _region.setName(name);
283            }
284    
285            @Override
286            public void setNew(boolean n) {
287                    _region.setNew(n);
288            }
289    
290            /**
291            * Sets the primary key of this region.
292            *
293            * @param primaryKey the primary key of this region
294            */
295            @Override
296            public void setPrimaryKey(long primaryKey) {
297                    _region.setPrimaryKey(primaryKey);
298            }
299    
300            @Override
301            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
302                    _region.setPrimaryKeyObj(primaryKeyObj);
303            }
304    
305            /**
306            * Sets the region code of this region.
307            *
308            * @param regionCode the region code of this region
309            */
310            @Override
311            public void setRegionCode(java.lang.String regionCode) {
312                    _region.setRegionCode(regionCode);
313            }
314    
315            /**
316            * Sets the region ID of this region.
317            *
318            * @param regionId the region ID of this region
319            */
320            @Override
321            public void setRegionId(long regionId) {
322                    _region.setRegionId(regionId);
323            }
324    
325            @Override
326            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Region> toCacheModel() {
327                    return _region.toCacheModel();
328            }
329    
330            @Override
331            public com.liferay.portal.model.Region toEscapedModel() {
332                    return new RegionWrapper(_region.toEscapedModel());
333            }
334    
335            @Override
336            public java.lang.String toString() {
337                    return _region.toString();
338            }
339    
340            @Override
341            public com.liferay.portal.model.Region toUnescapedModel() {
342                    return new RegionWrapper(_region.toUnescapedModel());
343            }
344    
345            @Override
346            public java.lang.String toXmlString() {
347                    return _region.toXmlString();
348            }
349    
350            @Override
351            public boolean equals(Object obj) {
352                    if (this == obj) {
353                            return true;
354                    }
355    
356                    if (!(obj instanceof RegionWrapper)) {
357                            return false;
358                    }
359    
360                    RegionWrapper regionWrapper = (RegionWrapper)obj;
361    
362                    if (Validator.equals(_region, regionWrapper._region)) {
363                            return true;
364                    }
365    
366                    return false;
367            }
368    
369            /**
370             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
371             */
372            @Deprecated
373            public Region getWrappedRegion() {
374                    return _region;
375            }
376    
377            @Override
378            public Region getWrappedModel() {
379                    return _region;
380            }
381    
382            @Override
383            public boolean isEntityCacheEnabled() {
384                    return _region.isEntityCacheEnabled();
385            }
386    
387            @Override
388            public boolean isFinderCacheEnabled() {
389                    return _region.isFinderCacheEnabled();
390            }
391    
392            @Override
393            public void resetOriginalValues() {
394                    _region.resetOriginalValues();
395            }
396    
397            private final Region _region;
398    }