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    import com.liferay.portal.kernel.util.Validator;
025    
026    import java.io.Serializable;
027    
028    import java.util.Date;
029    import java.util.HashMap;
030    import java.util.Map;
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 java.lang.Object clone() {
168                    return new PhoneWrapper((Phone)_phone.clone());
169            }
170    
171            @Override
172            public int compareTo(com.liferay.portal.kernel.model.Phone phone) {
173                    return _phone.compareTo(phone);
174            }
175    
176            /**
177            * Returns the fully qualified class name of this phone.
178            *
179            * @return the fully qualified class name of this phone
180            */
181            @Override
182            public java.lang.String getClassName() {
183                    return _phone.getClassName();
184            }
185    
186            /**
187            * Returns the class name ID of this phone.
188            *
189            * @return the class name ID of this phone
190            */
191            @Override
192            public long getClassNameId() {
193                    return _phone.getClassNameId();
194            }
195    
196            /**
197            * Returns the class p k of this phone.
198            *
199            * @return the class p k of this phone
200            */
201            @Override
202            public long getClassPK() {
203                    return _phone.getClassPK();
204            }
205    
206            /**
207            * Returns the company ID of this phone.
208            *
209            * @return the company ID of this phone
210            */
211            @Override
212            public long getCompanyId() {
213                    return _phone.getCompanyId();
214            }
215    
216            /**
217            * Returns the create date of this phone.
218            *
219            * @return the create date of this phone
220            */
221            @Override
222            public Date getCreateDate() {
223                    return _phone.getCreateDate();
224            }
225    
226            @Override
227            public ExpandoBridge getExpandoBridge() {
228                    return _phone.getExpandoBridge();
229            }
230    
231            /**
232            * Returns the extension of this phone.
233            *
234            * @return the extension of this phone
235            */
236            @Override
237            public java.lang.String getExtension() {
238                    return _phone.getExtension();
239            }
240    
241            /**
242            * Returns the modified date of this phone.
243            *
244            * @return the modified date of this phone
245            */
246            @Override
247            public Date getModifiedDate() {
248                    return _phone.getModifiedDate();
249            }
250    
251            /**
252            * Returns the mvcc version of this phone.
253            *
254            * @return the mvcc version of this phone
255            */
256            @Override
257            public long getMvccVersion() {
258                    return _phone.getMvccVersion();
259            }
260    
261            /**
262            * Returns the number of this phone.
263            *
264            * @return the number of this phone
265            */
266            @Override
267            public java.lang.String getNumber() {
268                    return _phone.getNumber();
269            }
270    
271            /**
272            * Returns the phone ID of this phone.
273            *
274            * @return the phone ID of this phone
275            */
276            @Override
277            public long getPhoneId() {
278                    return _phone.getPhoneId();
279            }
280    
281            /**
282            * Returns the primary of this phone.
283            *
284            * @return the primary of this phone
285            */
286            @Override
287            public boolean getPrimary() {
288                    return _phone.getPrimary();
289            }
290    
291            /**
292            * Returns the primary key of this phone.
293            *
294            * @return the primary key of this phone
295            */
296            @Override
297            public long getPrimaryKey() {
298                    return _phone.getPrimaryKey();
299            }
300    
301            @Override
302            public Serializable getPrimaryKeyObj() {
303                    return _phone.getPrimaryKeyObj();
304            }
305    
306            @Override
307            public com.liferay.portal.kernel.model.ListType getType()
308                    throws com.liferay.portal.kernel.exception.PortalException {
309                    return _phone.getType();
310            }
311    
312            /**
313            * Returns the type ID of this phone.
314            *
315            * @return the type ID of this phone
316            */
317            @Override
318            public long getTypeId() {
319                    return _phone.getTypeId();
320            }
321    
322            /**
323            * Returns the user ID of this phone.
324            *
325            * @return the user ID of this phone
326            */
327            @Override
328            public long getUserId() {
329                    return _phone.getUserId();
330            }
331    
332            /**
333            * Returns the user name of this phone.
334            *
335            * @return the user name of this phone
336            */
337            @Override
338            public java.lang.String getUserName() {
339                    return _phone.getUserName();
340            }
341    
342            /**
343            * Returns the user uuid of this phone.
344            *
345            * @return the user uuid of this phone
346            */
347            @Override
348            public java.lang.String getUserUuid() {
349                    return _phone.getUserUuid();
350            }
351    
352            /**
353            * Returns the uuid of this phone.
354            *
355            * @return the uuid of this phone
356            */
357            @Override
358            public java.lang.String getUuid() {
359                    return _phone.getUuid();
360            }
361    
362            @Override
363            public int hashCode() {
364                    return _phone.hashCode();
365            }
366    
367            @Override
368            public boolean isCachedModel() {
369                    return _phone.isCachedModel();
370            }
371    
372            @Override
373            public boolean isEscapedModel() {
374                    return _phone.isEscapedModel();
375            }
376    
377            @Override
378            public boolean isNew() {
379                    return _phone.isNew();
380            }
381    
382            /**
383            * Returns <code>true</code> if this phone is primary.
384            *
385            * @return <code>true</code> if this phone is primary; <code>false</code> otherwise
386            */
387            @Override
388            public boolean isPrimary() {
389                    return _phone.isPrimary();
390            }
391    
392            @Override
393            public void persist() {
394                    _phone.persist();
395            }
396    
397            @Override
398            public void setCachedModel(boolean cachedModel) {
399                    _phone.setCachedModel(cachedModel);
400            }
401    
402            @Override
403            public void setClassName(java.lang.String className) {
404                    _phone.setClassName(className);
405            }
406    
407            /**
408            * Sets the class name ID of this phone.
409            *
410            * @param classNameId the class name ID of this phone
411            */
412            @Override
413            public void setClassNameId(long classNameId) {
414                    _phone.setClassNameId(classNameId);
415            }
416    
417            /**
418            * Sets the class p k of this phone.
419            *
420            * @param classPK the class p k of this phone
421            */
422            @Override
423            public void setClassPK(long classPK) {
424                    _phone.setClassPK(classPK);
425            }
426    
427            /**
428            * Sets the company ID of this phone.
429            *
430            * @param companyId the company ID of this phone
431            */
432            @Override
433            public void setCompanyId(long companyId) {
434                    _phone.setCompanyId(companyId);
435            }
436    
437            /**
438            * Sets the create date of this phone.
439            *
440            * @param createDate the create date of this phone
441            */
442            @Override
443            public void setCreateDate(Date createDate) {
444                    _phone.setCreateDate(createDate);
445            }
446    
447            @Override
448            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
449                    _phone.setExpandoBridgeAttributes(baseModel);
450            }
451    
452            @Override
453            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
454                    _phone.setExpandoBridgeAttributes(expandoBridge);
455            }
456    
457            @Override
458            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
459                    _phone.setExpandoBridgeAttributes(serviceContext);
460            }
461    
462            /**
463            * Sets the extension of this phone.
464            *
465            * @param extension the extension of this phone
466            */
467            @Override
468            public void setExtension(java.lang.String extension) {
469                    _phone.setExtension(extension);
470            }
471    
472            /**
473            * Sets the modified date of this phone.
474            *
475            * @param modifiedDate the modified date of this phone
476            */
477            @Override
478            public void setModifiedDate(Date modifiedDate) {
479                    _phone.setModifiedDate(modifiedDate);
480            }
481    
482            /**
483            * Sets the mvcc version of this phone.
484            *
485            * @param mvccVersion the mvcc version of this phone
486            */
487            @Override
488            public void setMvccVersion(long mvccVersion) {
489                    _phone.setMvccVersion(mvccVersion);
490            }
491    
492            @Override
493            public void setNew(boolean n) {
494                    _phone.setNew(n);
495            }
496    
497            /**
498            * Sets the number of this phone.
499            *
500            * @param number the number of this phone
501            */
502            @Override
503            public void setNumber(java.lang.String number) {
504                    _phone.setNumber(number);
505            }
506    
507            /**
508            * Sets the phone ID of this phone.
509            *
510            * @param phoneId the phone ID of this phone
511            */
512            @Override
513            public void setPhoneId(long phoneId) {
514                    _phone.setPhoneId(phoneId);
515            }
516    
517            /**
518            * Sets whether this phone is primary.
519            *
520            * @param primary the primary of this phone
521            */
522            @Override
523            public void setPrimary(boolean primary) {
524                    _phone.setPrimary(primary);
525            }
526    
527            /**
528            * Sets the primary key of this phone.
529            *
530            * @param primaryKey the primary key of this phone
531            */
532            @Override
533            public void setPrimaryKey(long primaryKey) {
534                    _phone.setPrimaryKey(primaryKey);
535            }
536    
537            @Override
538            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
539                    _phone.setPrimaryKeyObj(primaryKeyObj);
540            }
541    
542            /**
543            * Sets the type ID of this phone.
544            *
545            * @param typeId the type ID of this phone
546            */
547            @Override
548            public void setTypeId(long typeId) {
549                    _phone.setTypeId(typeId);
550            }
551    
552            /**
553            * Sets the user ID of this phone.
554            *
555            * @param userId the user ID of this phone
556            */
557            @Override
558            public void setUserId(long userId) {
559                    _phone.setUserId(userId);
560            }
561    
562            /**
563            * Sets the user name of this phone.
564            *
565            * @param userName the user name of this phone
566            */
567            @Override
568            public void setUserName(java.lang.String userName) {
569                    _phone.setUserName(userName);
570            }
571    
572            /**
573            * Sets the user uuid of this phone.
574            *
575            * @param userUuid the user uuid of this phone
576            */
577            @Override
578            public void setUserUuid(java.lang.String userUuid) {
579                    _phone.setUserUuid(userUuid);
580            }
581    
582            /**
583            * Sets the uuid of this phone.
584            *
585            * @param uuid the uuid of this phone
586            */
587            @Override
588            public void setUuid(java.lang.String uuid) {
589                    _phone.setUuid(uuid);
590            }
591    
592            @Override
593            public CacheModel<com.liferay.portal.kernel.model.Phone> toCacheModel() {
594                    return _phone.toCacheModel();
595            }
596    
597            @Override
598            public com.liferay.portal.kernel.model.Phone toEscapedModel() {
599                    return new PhoneWrapper(_phone.toEscapedModel());
600            }
601    
602            @Override
603            public java.lang.String toString() {
604                    return _phone.toString();
605            }
606    
607            @Override
608            public com.liferay.portal.kernel.model.Phone toUnescapedModel() {
609                    return new PhoneWrapper(_phone.toUnescapedModel());
610            }
611    
612            @Override
613            public java.lang.String toXmlString() {
614                    return _phone.toXmlString();
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 (Validator.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    }