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