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