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