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