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