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