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