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