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.lar.StagedModelType;
020    import com.liferay.portal.kernel.util.Validator;
021    
022    import java.util.Date;
023    import java.util.HashMap;
024    import java.util.Map;
025    
026    /**
027     * <p>
028     * This class is a wrapper for {@link Phone}.
029     * </p>
030     *
031     * @author Brian Wing Shun Chan
032     * @see Phone
033     * @generated
034     */
035    @ProviderType
036    public class PhoneWrapper implements Phone, ModelWrapper<Phone> {
037            public PhoneWrapper(Phone phone) {
038                    _phone = phone;
039            }
040    
041            @Override
042            public Class<?> getModelClass() {
043                    return Phone.class;
044            }
045    
046            @Override
047            public String getModelClassName() {
048                    return Phone.class.getName();
049            }
050    
051            @Override
052            public Map<String, Object> getModelAttributes() {
053                    Map<String, Object> attributes = new HashMap<String, Object>();
054    
055                    attributes.put("mvccVersion", getMvccVersion());
056                    attributes.put("uuid", getUuid());
057                    attributes.put("phoneId", getPhoneId());
058                    attributes.put("companyId", getCompanyId());
059                    attributes.put("userId", getUserId());
060                    attributes.put("userName", getUserName());
061                    attributes.put("createDate", getCreateDate());
062                    attributes.put("modifiedDate", getModifiedDate());
063                    attributes.put("classNameId", getClassNameId());
064                    attributes.put("classPK", getClassPK());
065                    attributes.put("number", getNumber());
066                    attributes.put("extension", getExtension());
067                    attributes.put("typeId", getTypeId());
068                    attributes.put("primary", getPrimary());
069    
070                    return attributes;
071            }
072    
073            @Override
074            public void setModelAttributes(Map<String, Object> attributes) {
075                    Long mvccVersion = (Long)attributes.get("mvccVersion");
076    
077                    if (mvccVersion != null) {
078                            setMvccVersion(mvccVersion);
079                    }
080    
081                    String uuid = (String)attributes.get("uuid");
082    
083                    if (uuid != null) {
084                            setUuid(uuid);
085                    }
086    
087                    Long phoneId = (Long)attributes.get("phoneId");
088    
089                    if (phoneId != null) {
090                            setPhoneId(phoneId);
091                    }
092    
093                    Long companyId = (Long)attributes.get("companyId");
094    
095                    if (companyId != null) {
096                            setCompanyId(companyId);
097                    }
098    
099                    Long userId = (Long)attributes.get("userId");
100    
101                    if (userId != null) {
102                            setUserId(userId);
103                    }
104    
105                    String userName = (String)attributes.get("userName");
106    
107                    if (userName != null) {
108                            setUserName(userName);
109                    }
110    
111                    Date createDate = (Date)attributes.get("createDate");
112    
113                    if (createDate != null) {
114                            setCreateDate(createDate);
115                    }
116    
117                    Date modifiedDate = (Date)attributes.get("modifiedDate");
118    
119                    if (modifiedDate != null) {
120                            setModifiedDate(modifiedDate);
121                    }
122    
123                    Long classNameId = (Long)attributes.get("classNameId");
124    
125                    if (classNameId != null) {
126                            setClassNameId(classNameId);
127                    }
128    
129                    Long classPK = (Long)attributes.get("classPK");
130    
131                    if (classPK != null) {
132                            setClassPK(classPK);
133                    }
134    
135                    String number = (String)attributes.get("number");
136    
137                    if (number != null) {
138                            setNumber(number);
139                    }
140    
141                    String extension = (String)attributes.get("extension");
142    
143                    if (extension != null) {
144                            setExtension(extension);
145                    }
146    
147                    Integer typeId = (Integer)attributes.get("typeId");
148    
149                    if (typeId != null) {
150                            setTypeId(typeId);
151                    }
152    
153                    Boolean primary = (Boolean)attributes.get("primary");
154    
155                    if (primary != null) {
156                            setPrimary(primary);
157                    }
158            }
159    
160            @Override
161            public java.lang.Object clone() {
162                    return new PhoneWrapper((Phone)_phone.clone());
163            }
164    
165            @Override
166            public int compareTo(com.liferay.portal.model.Phone phone) {
167                    return _phone.compareTo(phone);
168            }
169    
170            /**
171            * Returns the fully qualified class name of this phone.
172            *
173            * @return the fully qualified class name of this phone
174            */
175            @Override
176            public java.lang.String getClassName() {
177                    return _phone.getClassName();
178            }
179    
180            /**
181            * Returns the class name ID of this phone.
182            *
183            * @return the class name ID of this phone
184            */
185            @Override
186            public long getClassNameId() {
187                    return _phone.getClassNameId();
188            }
189    
190            /**
191            * Returns the class p k of this phone.
192            *
193            * @return the class p k of this phone
194            */
195            @Override
196            public long getClassPK() {
197                    return _phone.getClassPK();
198            }
199    
200            /**
201            * Returns the company ID of this phone.
202            *
203            * @return the company ID of this phone
204            */
205            @Override
206            public long getCompanyId() {
207                    return _phone.getCompanyId();
208            }
209    
210            /**
211            * Returns the create date of this phone.
212            *
213            * @return the create date of this phone
214            */
215            @Override
216            public java.util.Date getCreateDate() {
217                    return _phone.getCreateDate();
218            }
219    
220            @Override
221            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
222                    return _phone.getExpandoBridge();
223            }
224    
225            /**
226            * Returns the extension of this phone.
227            *
228            * @return the extension of this phone
229            */
230            @Override
231            public java.lang.String getExtension() {
232                    return _phone.getExtension();
233            }
234    
235            /**
236            * Returns the modified date of this phone.
237            *
238            * @return the modified date of this phone
239            */
240            @Override
241            public java.util.Date getModifiedDate() {
242                    return _phone.getModifiedDate();
243            }
244    
245            /**
246            * Returns the mvcc version of this phone.
247            *
248            * @return the mvcc version of this phone
249            */
250            @Override
251            public long getMvccVersion() {
252                    return _phone.getMvccVersion();
253            }
254    
255            /**
256            * Returns the number of this phone.
257            *
258            * @return the number of this phone
259            */
260            @Override
261            public java.lang.String getNumber() {
262                    return _phone.getNumber();
263            }
264    
265            /**
266            * Returns the phone ID of this phone.
267            *
268            * @return the phone ID of this phone
269            */
270            @Override
271            public long getPhoneId() {
272                    return _phone.getPhoneId();
273            }
274    
275            /**
276            * Returns the primary of this phone.
277            *
278            * @return the primary of this phone
279            */
280            @Override
281            public boolean getPrimary() {
282                    return _phone.getPrimary();
283            }
284    
285            /**
286            * Returns the primary key of this phone.
287            *
288            * @return the primary key of this phone
289            */
290            @Override
291            public long getPrimaryKey() {
292                    return _phone.getPrimaryKey();
293            }
294    
295            @Override
296            public java.io.Serializable getPrimaryKeyObj() {
297                    return _phone.getPrimaryKeyObj();
298            }
299    
300            @Override
301            public com.liferay.portal.model.ListType getType()
302                    throws com.liferay.portal.kernel.exception.PortalException {
303                    return _phone.getType();
304            }
305    
306            /**
307            * Returns the type ID of this phone.
308            *
309            * @return the type ID of this phone
310            */
311            @Override
312            public int getTypeId() {
313                    return _phone.getTypeId();
314            }
315    
316            /**
317            * Returns the user ID of this phone.
318            *
319            * @return the user ID of this phone
320            */
321            @Override
322            public long getUserId() {
323                    return _phone.getUserId();
324            }
325    
326            /**
327            * Returns the user name of this phone.
328            *
329            * @return the user name of this phone
330            */
331            @Override
332            public java.lang.String getUserName() {
333                    return _phone.getUserName();
334            }
335    
336            /**
337            * Returns the user uuid of this phone.
338            *
339            * @return the user uuid of this phone
340            */
341            @Override
342            public java.lang.String getUserUuid() {
343                    return _phone.getUserUuid();
344            }
345    
346            /**
347            * Returns the uuid of this phone.
348            *
349            * @return the uuid of this phone
350            */
351            @Override
352            public java.lang.String getUuid() {
353                    return _phone.getUuid();
354            }
355    
356            @Override
357            public int hashCode() {
358                    return _phone.hashCode();
359            }
360    
361            @Override
362            public boolean isCachedModel() {
363                    return _phone.isCachedModel();
364            }
365    
366            @Override
367            public boolean isEscapedModel() {
368                    return _phone.isEscapedModel();
369            }
370    
371            @Override
372            public boolean isNew() {
373                    return _phone.isNew();
374            }
375    
376            /**
377            * Returns <code>true</code> if this phone is primary.
378            *
379            * @return <code>true</code> if this phone is primary; <code>false</code> otherwise
380            */
381            @Override
382            public boolean isPrimary() {
383                    return _phone.isPrimary();
384            }
385    
386            @Override
387            public void persist() {
388                    _phone.persist();
389            }
390    
391            @Override
392            public void setCachedModel(boolean cachedModel) {
393                    _phone.setCachedModel(cachedModel);
394            }
395    
396            @Override
397            public void setClassName(java.lang.String className) {
398                    _phone.setClassName(className);
399            }
400    
401            /**
402            * Sets the class name ID of this phone.
403            *
404            * @param classNameId the class name ID of this phone
405            */
406            @Override
407            public void setClassNameId(long classNameId) {
408                    _phone.setClassNameId(classNameId);
409            }
410    
411            /**
412            * Sets the class p k of this phone.
413            *
414            * @param classPK the class p k of this phone
415            */
416            @Override
417            public void setClassPK(long classPK) {
418                    _phone.setClassPK(classPK);
419            }
420    
421            /**
422            * Sets the company ID of this phone.
423            *
424            * @param companyId the company ID of this phone
425            */
426            @Override
427            public void setCompanyId(long companyId) {
428                    _phone.setCompanyId(companyId);
429            }
430    
431            /**
432            * Sets the create date of this phone.
433            *
434            * @param createDate the create date of this phone
435            */
436            @Override
437            public void setCreateDate(java.util.Date createDate) {
438                    _phone.setCreateDate(createDate);
439            }
440    
441            @Override
442            public void setExpandoBridgeAttributes(
443                    com.liferay.portal.model.BaseModel<?> baseModel) {
444                    _phone.setExpandoBridgeAttributes(baseModel);
445            }
446    
447            @Override
448            public void setExpandoBridgeAttributes(
449                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
450                    _phone.setExpandoBridgeAttributes(expandoBridge);
451            }
452    
453            @Override
454            public void setExpandoBridgeAttributes(
455                    com.liferay.portal.service.ServiceContext serviceContext) {
456                    _phone.setExpandoBridgeAttributes(serviceContext);
457            }
458    
459            /**
460            * Sets the extension of this phone.
461            *
462            * @param extension the extension of this phone
463            */
464            @Override
465            public void setExtension(java.lang.String extension) {
466                    _phone.setExtension(extension);
467            }
468    
469            /**
470            * Sets the modified date of this phone.
471            *
472            * @param modifiedDate the modified date of this phone
473            */
474            @Override
475            public void setModifiedDate(java.util.Date modifiedDate) {
476                    _phone.setModifiedDate(modifiedDate);
477            }
478    
479            /**
480            * Sets the mvcc version of this phone.
481            *
482            * @param mvccVersion the mvcc version of this phone
483            */
484            @Override
485            public void setMvccVersion(long mvccVersion) {
486                    _phone.setMvccVersion(mvccVersion);
487            }
488    
489            @Override
490            public void setNew(boolean n) {
491                    _phone.setNew(n);
492            }
493    
494            /**
495            * Sets the number of this phone.
496            *
497            * @param number the number of this phone
498            */
499            @Override
500            public void setNumber(java.lang.String number) {
501                    _phone.setNumber(number);
502            }
503    
504            /**
505            * Sets the phone ID of this phone.
506            *
507            * @param phoneId the phone ID of this phone
508            */
509            @Override
510            public void setPhoneId(long phoneId) {
511                    _phone.setPhoneId(phoneId);
512            }
513    
514            /**
515            * Sets whether this phone is primary.
516            *
517            * @param primary the primary of this phone
518            */
519            @Override
520            public void setPrimary(boolean primary) {
521                    _phone.setPrimary(primary);
522            }
523    
524            /**
525            * Sets the primary key of this phone.
526            *
527            * @param primaryKey the primary key of this phone
528            */
529            @Override
530            public void setPrimaryKey(long primaryKey) {
531                    _phone.setPrimaryKey(primaryKey);
532            }
533    
534            @Override
535            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
536                    _phone.setPrimaryKeyObj(primaryKeyObj);
537            }
538    
539            /**
540            * Sets the type ID of this phone.
541            *
542            * @param typeId the type ID of this phone
543            */
544            @Override
545            public void setTypeId(int typeId) {
546                    _phone.setTypeId(typeId);
547            }
548    
549            /**
550            * Sets the user ID of this phone.
551            *
552            * @param userId the user ID of this phone
553            */
554            @Override
555            public void setUserId(long userId) {
556                    _phone.setUserId(userId);
557            }
558    
559            /**
560            * Sets the user name of this phone.
561            *
562            * @param userName the user name of this phone
563            */
564            @Override
565            public void setUserName(java.lang.String userName) {
566                    _phone.setUserName(userName);
567            }
568    
569            /**
570            * Sets the user uuid of this phone.
571            *
572            * @param userUuid the user uuid of this phone
573            */
574            @Override
575            public void setUserUuid(java.lang.String userUuid) {
576                    _phone.setUserUuid(userUuid);
577            }
578    
579            /**
580            * Sets the uuid of this phone.
581            *
582            * @param uuid the uuid of this phone
583            */
584            @Override
585            public void setUuid(java.lang.String uuid) {
586                    _phone.setUuid(uuid);
587            }
588    
589            @Override
590            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Phone> toCacheModel() {
591                    return _phone.toCacheModel();
592            }
593    
594            @Override
595            public com.liferay.portal.model.Phone toEscapedModel() {
596                    return new PhoneWrapper(_phone.toEscapedModel());
597            }
598    
599            @Override
600            public java.lang.String toString() {
601                    return _phone.toString();
602            }
603    
604            @Override
605            public com.liferay.portal.model.Phone toUnescapedModel() {
606                    return new PhoneWrapper(_phone.toUnescapedModel());
607            }
608    
609            @Override
610            public java.lang.String toXmlString() {
611                    return _phone.toXmlString();
612            }
613    
614            @Override
615            public boolean equals(Object obj) {
616                    if (this == obj) {
617                            return true;
618                    }
619    
620                    if (!(obj instanceof PhoneWrapper)) {
621                            return false;
622                    }
623    
624                    PhoneWrapper phoneWrapper = (PhoneWrapper)obj;
625    
626                    if (Validator.equals(_phone, phoneWrapper._phone)) {
627                            return true;
628                    }
629    
630                    return false;
631            }
632    
633            @Override
634            public StagedModelType getStagedModelType() {
635                    return _phone.getStagedModelType();
636            }
637    
638            /**
639             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
640             */
641            @Deprecated
642            public Phone getWrappedPhone() {
643                    return _phone;
644            }
645    
646            @Override
647            public Phone getWrappedModel() {
648                    return _phone;
649            }
650    
651            @Override
652            public boolean isEntityCacheEnabled() {
653                    return _phone.isEntityCacheEnabled();
654            }
655    
656            @Override
657            public boolean isFinderCacheEnabled() {
658                    return _phone.isFinderCacheEnabled();
659            }
660    
661            @Override
662            public void resetOriginalValues() {
663                    _phone.resetOriginalValues();
664            }
665    
666            private final Phone _phone;
667    }