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.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link ListType}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       ListType
029     * @generated
030     */
031    public class ListTypeWrapper implements ListType, ModelWrapper<ListType> {
032            public ListTypeWrapper(ListType listType) {
033                    _listType = listType;
034            }
035    
036            public Class<?> getModelClass() {
037                    return ListType.class;
038            }
039    
040            public String getModelClassName() {
041                    return ListType.class.getName();
042            }
043    
044            public Map<String, Object> getModelAttributes() {
045                    Map<String, Object> attributes = new HashMap<String, Object>();
046    
047                    attributes.put("listTypeId", getListTypeId());
048                    attributes.put("name", getName());
049                    attributes.put("type", getType());
050    
051                    return attributes;
052            }
053    
054            public void setModelAttributes(Map<String, Object> attributes) {
055                    Integer listTypeId = (Integer)attributes.get("listTypeId");
056    
057                    if (listTypeId != null) {
058                            setListTypeId(listTypeId);
059                    }
060    
061                    String name = (String)attributes.get("name");
062    
063                    if (name != null) {
064                            setName(name);
065                    }
066    
067                    String type = (String)attributes.get("type");
068    
069                    if (type != null) {
070                            setType(type);
071                    }
072            }
073    
074            /**
075            * Returns the primary key of this list type.
076            *
077            * @return the primary key of this list type
078            */
079            public int getPrimaryKey() {
080                    return _listType.getPrimaryKey();
081            }
082    
083            /**
084            * Sets the primary key of this list type.
085            *
086            * @param primaryKey the primary key of this list type
087            */
088            public void setPrimaryKey(int primaryKey) {
089                    _listType.setPrimaryKey(primaryKey);
090            }
091    
092            /**
093            * Returns the list type ID of this list type.
094            *
095            * @return the list type ID of this list type
096            */
097            public int getListTypeId() {
098                    return _listType.getListTypeId();
099            }
100    
101            /**
102            * Sets the list type ID of this list type.
103            *
104            * @param listTypeId the list type ID of this list type
105            */
106            public void setListTypeId(int listTypeId) {
107                    _listType.setListTypeId(listTypeId);
108            }
109    
110            /**
111            * Returns the name of this list type.
112            *
113            * @return the name of this list type
114            */
115            public java.lang.String getName() {
116                    return _listType.getName();
117            }
118    
119            /**
120            * Sets the name of this list type.
121            *
122            * @param name the name of this list type
123            */
124            public void setName(java.lang.String name) {
125                    _listType.setName(name);
126            }
127    
128            /**
129            * Returns the type of this list type.
130            *
131            * @return the type of this list type
132            */
133            public java.lang.String getType() {
134                    return _listType.getType();
135            }
136    
137            /**
138            * Sets the type of this list type.
139            *
140            * @param type the type of this list type
141            */
142            public void setType(java.lang.String type) {
143                    _listType.setType(type);
144            }
145    
146            public boolean isNew() {
147                    return _listType.isNew();
148            }
149    
150            public void setNew(boolean n) {
151                    _listType.setNew(n);
152            }
153    
154            public boolean isCachedModel() {
155                    return _listType.isCachedModel();
156            }
157    
158            public void setCachedModel(boolean cachedModel) {
159                    _listType.setCachedModel(cachedModel);
160            }
161    
162            public boolean isEscapedModel() {
163                    return _listType.isEscapedModel();
164            }
165    
166            public java.io.Serializable getPrimaryKeyObj() {
167                    return _listType.getPrimaryKeyObj();
168            }
169    
170            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
171                    _listType.setPrimaryKeyObj(primaryKeyObj);
172            }
173    
174            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
175                    return _listType.getExpandoBridge();
176            }
177    
178            public void setExpandoBridgeAttributes(
179                    com.liferay.portal.service.ServiceContext serviceContext) {
180                    _listType.setExpandoBridgeAttributes(serviceContext);
181            }
182    
183            @Override
184            public java.lang.Object clone() {
185                    return new ListTypeWrapper((ListType)_listType.clone());
186            }
187    
188            public int compareTo(com.liferay.portal.model.ListType listType) {
189                    return _listType.compareTo(listType);
190            }
191    
192            @Override
193            public int hashCode() {
194                    return _listType.hashCode();
195            }
196    
197            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ListType> toCacheModel() {
198                    return _listType.toCacheModel();
199            }
200    
201            public com.liferay.portal.model.ListType toEscapedModel() {
202                    return new ListTypeWrapper(_listType.toEscapedModel());
203            }
204    
205            public com.liferay.portal.model.ListType toUnescapedModel() {
206                    return new ListTypeWrapper(_listType.toUnescapedModel());
207            }
208    
209            @Override
210            public java.lang.String toString() {
211                    return _listType.toString();
212            }
213    
214            public java.lang.String toXmlString() {
215                    return _listType.toXmlString();
216            }
217    
218            @Override
219            public boolean equals(Object obj) {
220                    if (this == obj) {
221                            return true;
222                    }
223    
224                    if (!(obj instanceof ListTypeWrapper)) {
225                            return false;
226                    }
227    
228                    ListTypeWrapper listTypeWrapper = (ListTypeWrapper)obj;
229    
230                    if (Validator.equals(_listType, listTypeWrapper._listType)) {
231                            return true;
232                    }
233    
234                    return false;
235            }
236    
237            /**
238             * @deprecated Renamed to {@link #getWrappedModel}
239             */
240            public ListType getWrappedListType() {
241                    return _listType;
242            }
243    
244            public ListType getWrappedModel() {
245                    return _listType;
246            }
247    
248            public void resetOriginalValues() {
249                    _listType.resetOriginalValues();
250            }
251    
252            private ListType _listType;
253    }