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.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.portal.kernel.service.ServiceContext;
022    
023    import java.io.Serializable;
024    
025    import java.util.HashMap;
026    import java.util.Map;
027    import java.util.Objects;
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 CacheModel<Country> toCacheModel() {
130                    return _country.toCacheModel();
131            }
132    
133            @Override
134            public Country toEscapedModel() {
135                    return new CountryWrapper(_country.toEscapedModel());
136            }
137    
138            @Override
139            public Country toUnescapedModel() {
140                    return new CountryWrapper(_country.toUnescapedModel());
141            }
142    
143            /**
144            * Returns the active of this country.
145            *
146            * @return the active of this country
147            */
148            @Override
149            public boolean getActive() {
150                    return _country.getActive();
151            }
152    
153            /**
154            * Returns the zip required of this country.
155            *
156            * @return the zip required of this country
157            */
158            @Override
159            public boolean getZipRequired() {
160                    return _country.getZipRequired();
161            }
162    
163            /**
164            * Returns <code>true</code> if this country is active.
165            *
166            * @return <code>true</code> if this country is active; <code>false</code> otherwise
167            */
168            @Override
169            public boolean isActive() {
170                    return _country.isActive();
171            }
172    
173            @Override
174            public boolean isCachedModel() {
175                    return _country.isCachedModel();
176            }
177    
178            @Override
179            public boolean isEscapedModel() {
180                    return _country.isEscapedModel();
181            }
182    
183            @Override
184            public boolean isNew() {
185                    return _country.isNew();
186            }
187    
188            /**
189            * Returns <code>true</code> if this country is zip required.
190            *
191            * @return <code>true</code> if this country is zip required; <code>false</code> otherwise
192            */
193            @Override
194            public boolean isZipRequired() {
195                    return _country.isZipRequired();
196            }
197    
198            @Override
199            public ExpandoBridge getExpandoBridge() {
200                    return _country.getExpandoBridge();
201            }
202    
203            @Override
204            public int compareTo(Country country) {
205                    return _country.compareTo(country);
206            }
207    
208            @Override
209            public int hashCode() {
210                    return _country.hashCode();
211            }
212    
213            @Override
214            public Serializable getPrimaryKeyObj() {
215                    return _country.getPrimaryKeyObj();
216            }
217    
218            @Override
219            public java.lang.Object clone() {
220                    return new CountryWrapper((Country)_country.clone());
221            }
222    
223            /**
224            * Returns the a2 of this country.
225            *
226            * @return the a2 of this country
227            */
228            @Override
229            public java.lang.String getA2() {
230                    return _country.getA2();
231            }
232    
233            /**
234            * Returns the a3 of this country.
235            *
236            * @return the a3 of this country
237            */
238            @Override
239            public java.lang.String getA3() {
240                    return _country.getA3();
241            }
242    
243            /**
244            * Returns the idd of this country.
245            *
246            * @return the idd of this country
247            */
248            @Override
249            public java.lang.String getIdd() {
250                    return _country.getIdd();
251            }
252    
253            /**
254            * Returns the name of this country.
255            *
256            * @return the name of this country
257            */
258            @Override
259            public java.lang.String getName() {
260                    return _country.getName();
261            }
262    
263            @Override
264            public java.lang.String getName(java.util.Locale locale) {
265                    return _country.getName(locale);
266            }
267    
268            @Override
269            public java.lang.String getNameCurrentLanguageId() {
270                    return _country.getNameCurrentLanguageId();
271            }
272    
273            @Override
274            public java.lang.String getNameCurrentValue() {
275                    return _country.getNameCurrentValue();
276            }
277    
278            /**
279            * Returns the number of this country.
280            *
281            * @return the number of this country
282            */
283            @Override
284            public java.lang.String getNumber() {
285                    return _country.getNumber();
286            }
287    
288            @Override
289            public java.lang.String toString() {
290                    return _country.toString();
291            }
292    
293            @Override
294            public java.lang.String toXmlString() {
295                    return _country.toXmlString();
296            }
297    
298            /**
299            * Returns the country ID of this country.
300            *
301            * @return the country ID of this country
302            */
303            @Override
304            public long getCountryId() {
305                    return _country.getCountryId();
306            }
307    
308            /**
309            * Returns the mvcc version of this country.
310            *
311            * @return the mvcc version of this country
312            */
313            @Override
314            public long getMvccVersion() {
315                    return _country.getMvccVersion();
316            }
317    
318            /**
319            * Returns the primary key of this country.
320            *
321            * @return the primary key of this country
322            */
323            @Override
324            public long getPrimaryKey() {
325                    return _country.getPrimaryKey();
326            }
327    
328            /**
329            * Sets the a2 of this country.
330            *
331            * @param a2 the a2 of this country
332            */
333            @Override
334            public void setA2(java.lang.String a2) {
335                    _country.setA2(a2);
336            }
337    
338            /**
339            * Sets the a3 of this country.
340            *
341            * @param a3 the a3 of this country
342            */
343            @Override
344            public void setA3(java.lang.String a3) {
345                    _country.setA3(a3);
346            }
347    
348            /**
349            * Sets whether this country is active.
350            *
351            * @param active the active of this country
352            */
353            @Override
354            public void setActive(boolean active) {
355                    _country.setActive(active);
356            }
357    
358            @Override
359            public void setCachedModel(boolean cachedModel) {
360                    _country.setCachedModel(cachedModel);
361            }
362    
363            /**
364            * Sets the country ID of this country.
365            *
366            * @param countryId the country ID of this country
367            */
368            @Override
369            public void setCountryId(long countryId) {
370                    _country.setCountryId(countryId);
371            }
372    
373            @Override
374            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
375                    _country.setExpandoBridgeAttributes(baseModel);
376            }
377    
378            @Override
379            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
380                    _country.setExpandoBridgeAttributes(expandoBridge);
381            }
382    
383            @Override
384            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
385                    _country.setExpandoBridgeAttributes(serviceContext);
386            }
387    
388            /**
389            * Sets the idd of this country.
390            *
391            * @param idd the idd of this country
392            */
393            @Override
394            public void setIdd(java.lang.String idd) {
395                    _country.setIdd(idd);
396            }
397    
398            /**
399            * Sets the mvcc version of this country.
400            *
401            * @param mvccVersion the mvcc version of this country
402            */
403            @Override
404            public void setMvccVersion(long mvccVersion) {
405                    _country.setMvccVersion(mvccVersion);
406            }
407    
408            /**
409            * Sets the name of this country.
410            *
411            * @param name the name of this country
412            */
413            @Override
414            public void setName(java.lang.String name) {
415                    _country.setName(name);
416            }
417    
418            @Override
419            public void setNameCurrentLanguageId(java.lang.String languageId) {
420                    _country.setNameCurrentLanguageId(languageId);
421            }
422    
423            @Override
424            public void setNew(boolean n) {
425                    _country.setNew(n);
426            }
427    
428            /**
429            * Sets the number of this country.
430            *
431            * @param number the number of this country
432            */
433            @Override
434            public void setNumber(java.lang.String number) {
435                    _country.setNumber(number);
436            }
437    
438            /**
439            * Sets the primary key of this country.
440            *
441            * @param primaryKey the primary key of this country
442            */
443            @Override
444            public void setPrimaryKey(long primaryKey) {
445                    _country.setPrimaryKey(primaryKey);
446            }
447    
448            @Override
449            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
450                    _country.setPrimaryKeyObj(primaryKeyObj);
451            }
452    
453            /**
454            * Sets whether this country is zip required.
455            *
456            * @param zipRequired the zip required of this country
457            */
458            @Override
459            public void setZipRequired(boolean zipRequired) {
460                    _country.setZipRequired(zipRequired);
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 (Objects.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    }