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