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    
023    import java.io.Serializable;
024    
025    import java.util.HashMap;
026    import java.util.Map;
027    import java.util.Objects;
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 CacheModel<Region> toCacheModel() {
109                    return _region.toCacheModel();
110            }
111    
112            @Override
113            public Region toEscapedModel() {
114                    return new RegionWrapper(_region.toEscapedModel());
115            }
116    
117            @Override
118            public Region toUnescapedModel() {
119                    return new RegionWrapper(_region.toUnescapedModel());
120            }
121    
122            /**
123            * Returns the active of this region.
124            *
125            * @return the active of this region
126            */
127            @Override
128            public boolean getActive() {
129                    return _region.getActive();
130            }
131    
132            /**
133            * Returns <code>true</code> if this region is active.
134            *
135            * @return <code>true</code> if this region is active; <code>false</code> otherwise
136            */
137            @Override
138            public boolean isActive() {
139                    return _region.isActive();
140            }
141    
142            @Override
143            public boolean isCachedModel() {
144                    return _region.isCachedModel();
145            }
146    
147            @Override
148            public boolean isEscapedModel() {
149                    return _region.isEscapedModel();
150            }
151    
152            @Override
153            public boolean isNew() {
154                    return _region.isNew();
155            }
156    
157            @Override
158            public ExpandoBridge getExpandoBridge() {
159                    return _region.getExpandoBridge();
160            }
161    
162            @Override
163            public int compareTo(Region region) {
164                    return _region.compareTo(region);
165            }
166    
167            @Override
168            public int hashCode() {
169                    return _region.hashCode();
170            }
171    
172            @Override
173            public Serializable getPrimaryKeyObj() {
174                    return _region.getPrimaryKeyObj();
175            }
176    
177            @Override
178            public java.lang.Object clone() {
179                    return new RegionWrapper((Region)_region.clone());
180            }
181    
182            /**
183            * Returns the name of this region.
184            *
185            * @return the name of this region
186            */
187            @Override
188            public java.lang.String getName() {
189                    return _region.getName();
190            }
191    
192            /**
193            * Returns the region code of this region.
194            *
195            * @return the region code of this region
196            */
197            @Override
198            public java.lang.String getRegionCode() {
199                    return _region.getRegionCode();
200            }
201    
202            @Override
203            public java.lang.String toString() {
204                    return _region.toString();
205            }
206    
207            @Override
208            public java.lang.String toXmlString() {
209                    return _region.toXmlString();
210            }
211    
212            /**
213            * Returns the country ID of this region.
214            *
215            * @return the country ID of this region
216            */
217            @Override
218            public long getCountryId() {
219                    return _region.getCountryId();
220            }
221    
222            /**
223            * Returns the mvcc version of this region.
224            *
225            * @return the mvcc version of this region
226            */
227            @Override
228            public long getMvccVersion() {
229                    return _region.getMvccVersion();
230            }
231    
232            /**
233            * Returns the primary key of this region.
234            *
235            * @return the primary key of this region
236            */
237            @Override
238            public long getPrimaryKey() {
239                    return _region.getPrimaryKey();
240            }
241    
242            /**
243            * Returns the region ID of this region.
244            *
245            * @return the region ID of this region
246            */
247            @Override
248            public long getRegionId() {
249                    return _region.getRegionId();
250            }
251    
252            /**
253            * Sets whether this region is active.
254            *
255            * @param active the active of this region
256            */
257            @Override
258            public void setActive(boolean active) {
259                    _region.setActive(active);
260            }
261    
262            @Override
263            public void setCachedModel(boolean cachedModel) {
264                    _region.setCachedModel(cachedModel);
265            }
266    
267            /**
268            * Sets the country ID of this region.
269            *
270            * @param countryId the country ID of this region
271            */
272            @Override
273            public void setCountryId(long countryId) {
274                    _region.setCountryId(countryId);
275            }
276    
277            @Override
278            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
279                    _region.setExpandoBridgeAttributes(baseModel);
280            }
281    
282            @Override
283            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
284                    _region.setExpandoBridgeAttributes(expandoBridge);
285            }
286    
287            @Override
288            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
289                    _region.setExpandoBridgeAttributes(serviceContext);
290            }
291    
292            /**
293            * Sets the mvcc version of this region.
294            *
295            * @param mvccVersion the mvcc version of this region
296            */
297            @Override
298            public void setMvccVersion(long mvccVersion) {
299                    _region.setMvccVersion(mvccVersion);
300            }
301    
302            /**
303            * Sets the name of this region.
304            *
305            * @param name the name of this region
306            */
307            @Override
308            public void setName(java.lang.String name) {
309                    _region.setName(name);
310            }
311    
312            @Override
313            public void setNew(boolean n) {
314                    _region.setNew(n);
315            }
316    
317            /**
318            * Sets the primary key of this region.
319            *
320            * @param primaryKey the primary key of this region
321            */
322            @Override
323            public void setPrimaryKey(long primaryKey) {
324                    _region.setPrimaryKey(primaryKey);
325            }
326    
327            @Override
328            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
329                    _region.setPrimaryKeyObj(primaryKeyObj);
330            }
331    
332            /**
333            * Sets the region code of this region.
334            *
335            * @param regionCode the region code of this region
336            */
337            @Override
338            public void setRegionCode(java.lang.String regionCode) {
339                    _region.setRegionCode(regionCode);
340            }
341    
342            /**
343            * Sets the region ID of this region.
344            *
345            * @param regionId the region ID of this region
346            */
347            @Override
348            public void setRegionId(long regionId) {
349                    _region.setRegionId(regionId);
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 (Objects.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    }