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