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