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