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 Country}.
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see Country
031     * @generated
032     */
033    @ProviderType
034    public class CountryWrapper implements Country, ModelWrapper<Country> {
035            public CountryWrapper(Country country) {
036                    _country = country;
037            }
038    
039            @Override
040            public Class<?> getModelClass() {
041                    return Country.class;
042            }
043    
044            @Override
045            public String getModelClassName() {
046                    return Country.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("countryId", getCountryId());
055                    attributes.put("name", getName());
056                    attributes.put("a2", getA2());
057                    attributes.put("a3", getA3());
058                    attributes.put("number", getNumber());
059                    attributes.put("idd", getIdd());
060                    attributes.put("zipRequired", getZipRequired());
061                    attributes.put("active", getActive());
062    
063                    return attributes;
064            }
065    
066            @Override
067            public void setModelAttributes(Map<String, Object> attributes) {
068                    Long mvccVersion = (Long)attributes.get("mvccVersion");
069    
070                    if (mvccVersion != null) {
071                            setMvccVersion(mvccVersion);
072                    }
073    
074                    Long countryId = (Long)attributes.get("countryId");
075    
076                    if (countryId != null) {
077                            setCountryId(countryId);
078                    }
079    
080                    String name = (String)attributes.get("name");
081    
082                    if (name != null) {
083                            setName(name);
084                    }
085    
086                    String a2 = (String)attributes.get("a2");
087    
088                    if (a2 != null) {
089                            setA2(a2);
090                    }
091    
092                    String a3 = (String)attributes.get("a3");
093    
094                    if (a3 != null) {
095                            setA3(a3);
096                    }
097    
098                    String number = (String)attributes.get("number");
099    
100                    if (number != null) {
101                            setNumber(number);
102                    }
103    
104                    String idd = (String)attributes.get("idd");
105    
106                    if (idd != null) {
107                            setIdd(idd);
108                    }
109    
110                    Boolean zipRequired = (Boolean)attributes.get("zipRequired");
111    
112                    if (zipRequired != null) {
113                            setZipRequired(zipRequired);
114                    }
115    
116                    Boolean active = (Boolean)attributes.get("active");
117    
118                    if (active != null) {
119                            setActive(active);
120                    }
121            }
122    
123            @Override
124            public java.lang.Object clone() {
125                    return new CountryWrapper((Country)_country.clone());
126            }
127    
128            @Override
129            public int compareTo(com.liferay.portal.model.Country country) {
130                    return _country.compareTo(country);
131            }
132    
133            /**
134            * Returns the a2 of this country.
135            *
136            * @return the a2 of this country
137            */
138            @Override
139            public java.lang.String getA2() {
140                    return _country.getA2();
141            }
142    
143            /**
144            * Returns the a3 of this country.
145            *
146            * @return the a3 of this country
147            */
148            @Override
149            public java.lang.String getA3() {
150                    return _country.getA3();
151            }
152    
153            /**
154            * Returns the active of this country.
155            *
156            * @return the active of this country
157            */
158            @Override
159            public boolean getActive() {
160                    return _country.getActive();
161            }
162    
163            /**
164            * Returns the country ID of this country.
165            *
166            * @return the country ID of this country
167            */
168            @Override
169            public long getCountryId() {
170                    return _country.getCountryId();
171            }
172    
173            @Override
174            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
175                    return _country.getExpandoBridge();
176            }
177    
178            /**
179            * Returns the idd of this country.
180            *
181            * @return the idd of this country
182            */
183            @Override
184            public java.lang.String getIdd() {
185                    return _country.getIdd();
186            }
187    
188            /**
189            * Returns the mvcc version of this country.
190            *
191            * @return the mvcc version of this country
192            */
193            @Override
194            public long getMvccVersion() {
195                    return _country.getMvccVersion();
196            }
197    
198            /**
199            * Returns the name of this country.
200            *
201            * @return the name of this country
202            */
203            @Override
204            public java.lang.String getName() {
205                    return _country.getName();
206            }
207    
208            @Override
209            public java.lang.String getName(java.util.Locale locale) {
210                    return _country.getName(locale);
211            }
212    
213            @Override
214            public java.lang.String getNameCurrentLanguageId() {
215                    return _country.getNameCurrentLanguageId();
216            }
217    
218            @Override
219            public java.lang.String getNameCurrentValue() {
220                    return _country.getNameCurrentValue();
221            }
222    
223            /**
224            * Returns the number of this country.
225            *
226            * @return the number of this country
227            */
228            @Override
229            public java.lang.String getNumber() {
230                    return _country.getNumber();
231            }
232    
233            /**
234            * Returns the primary key of this country.
235            *
236            * @return the primary key of this country
237            */
238            @Override
239            public long getPrimaryKey() {
240                    return _country.getPrimaryKey();
241            }
242    
243            @Override
244            public java.io.Serializable getPrimaryKeyObj() {
245                    return _country.getPrimaryKeyObj();
246            }
247    
248            /**
249            * Returns the zip required of this country.
250            *
251            * @return the zip required of this country
252            */
253            @Override
254            public boolean getZipRequired() {
255                    return _country.getZipRequired();
256            }
257    
258            @Override
259            public int hashCode() {
260                    return _country.hashCode();
261            }
262    
263            /**
264            * Returns <code>true</code> if this country is active.
265            *
266            * @return <code>true</code> if this country is active; <code>false</code> otherwise
267            */
268            @Override
269            public boolean isActive() {
270                    return _country.isActive();
271            }
272    
273            @Override
274            public boolean isCachedModel() {
275                    return _country.isCachedModel();
276            }
277    
278            @Override
279            public boolean isEscapedModel() {
280                    return _country.isEscapedModel();
281            }
282    
283            @Override
284            public boolean isNew() {
285                    return _country.isNew();
286            }
287    
288            /**
289            * Returns <code>true</code> if this country is zip required.
290            *
291            * @return <code>true</code> if this country is zip required; <code>false</code> otherwise
292            */
293            @Override
294            public boolean isZipRequired() {
295                    return _country.isZipRequired();
296            }
297    
298            /**
299            * Sets the a2 of this country.
300            *
301            * @param a2 the a2 of this country
302            */
303            @Override
304            public void setA2(java.lang.String a2) {
305                    _country.setA2(a2);
306            }
307    
308            /**
309            * Sets the a3 of this country.
310            *
311            * @param a3 the a3 of this country
312            */
313            @Override
314            public void setA3(java.lang.String a3) {
315                    _country.setA3(a3);
316            }
317    
318            /**
319            * Sets whether this country is active.
320            *
321            * @param active the active of this country
322            */
323            @Override
324            public void setActive(boolean active) {
325                    _country.setActive(active);
326            }
327    
328            @Override
329            public void setCachedModel(boolean cachedModel) {
330                    _country.setCachedModel(cachedModel);
331            }
332    
333            /**
334            * Sets the country ID of this country.
335            *
336            * @param countryId the country ID of this country
337            */
338            @Override
339            public void setCountryId(long countryId) {
340                    _country.setCountryId(countryId);
341            }
342    
343            @Override
344            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
345                    _country.setExpandoBridgeAttributes(baseModel);
346            }
347    
348            @Override
349            public void setExpandoBridgeAttributes(
350                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
351                    _country.setExpandoBridgeAttributes(expandoBridge);
352            }
353    
354            @Override
355            public void setExpandoBridgeAttributes(
356                    com.liferay.portal.service.ServiceContext serviceContext) {
357                    _country.setExpandoBridgeAttributes(serviceContext);
358            }
359    
360            /**
361            * Sets the idd of this country.
362            *
363            * @param idd the idd of this country
364            */
365            @Override
366            public void setIdd(java.lang.String idd) {
367                    _country.setIdd(idd);
368            }
369    
370            /**
371            * Sets the mvcc version of this country.
372            *
373            * @param mvccVersion the mvcc version of this country
374            */
375            @Override
376            public void setMvccVersion(long mvccVersion) {
377                    _country.setMvccVersion(mvccVersion);
378            }
379    
380            /**
381            * Sets the name of this country.
382            *
383            * @param name the name of this country
384            */
385            @Override
386            public void setName(java.lang.String name) {
387                    _country.setName(name);
388            }
389    
390            @Override
391            public void setNameCurrentLanguageId(java.lang.String languageId) {
392                    _country.setNameCurrentLanguageId(languageId);
393            }
394    
395            @Override
396            public void setNew(boolean n) {
397                    _country.setNew(n);
398            }
399    
400            /**
401            * Sets the number of this country.
402            *
403            * @param number the number of this country
404            */
405            @Override
406            public void setNumber(java.lang.String number) {
407                    _country.setNumber(number);
408            }
409    
410            /**
411            * Sets the primary key of this country.
412            *
413            * @param primaryKey the primary key of this country
414            */
415            @Override
416            public void setPrimaryKey(long primaryKey) {
417                    _country.setPrimaryKey(primaryKey);
418            }
419    
420            @Override
421            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
422                    _country.setPrimaryKeyObj(primaryKeyObj);
423            }
424    
425            /**
426            * Sets whether this country is zip required.
427            *
428            * @param zipRequired the zip required of this country
429            */
430            @Override
431            public void setZipRequired(boolean zipRequired) {
432                    _country.setZipRequired(zipRequired);
433            }
434    
435            @Override
436            public CacheModel<com.liferay.portal.model.Country> toCacheModel() {
437                    return _country.toCacheModel();
438            }
439    
440            @Override
441            public com.liferay.portal.model.Country toEscapedModel() {
442                    return new CountryWrapper(_country.toEscapedModel());
443            }
444    
445            @Override
446            public java.lang.String toString() {
447                    return _country.toString();
448            }
449    
450            @Override
451            public com.liferay.portal.model.Country toUnescapedModel() {
452                    return new CountryWrapper(_country.toUnescapedModel());
453            }
454    
455            @Override
456            public java.lang.String toXmlString() {
457                    return _country.toXmlString();
458            }
459    
460            @Override
461            public boolean equals(Object obj) {
462                    if (this == obj) {
463                            return true;
464                    }
465    
466                    if (!(obj instanceof CountryWrapper)) {
467                            return false;
468                    }
469    
470                    CountryWrapper countryWrapper = (CountryWrapper)obj;
471    
472                    if (Validator.equals(_country, countryWrapper._country)) {
473                            return true;
474                    }
475    
476                    return false;
477            }
478    
479            @Override
480            public Country getWrappedModel() {
481                    return _country;
482            }
483    
484            @Override
485            public boolean isEntityCacheEnabled() {
486                    return _country.isEntityCacheEnabled();
487            }
488    
489            @Override
490            public boolean isFinderCacheEnabled() {
491                    return _country.isFinderCacheEnabled();
492            }
493    
494            @Override
495            public void resetOriginalValues() {
496                    _country.resetOriginalValues();
497            }
498    
499            private final Country _country;
500    }