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