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