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.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.portal.kernel.service.ServiceContext;
022    
023    import java.io.Serializable;
024    
025    import java.util.HashMap;
026    import java.util.Map;
027    import java.util.Objects;
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 CacheModel<ListType> toCacheModel() {
095                    return _listType.toCacheModel();
096            }
097    
098            @Override
099            public ListType toEscapedModel() {
100                    return new ListTypeWrapper(_listType.toEscapedModel());
101            }
102    
103            @Override
104            public ListType toUnescapedModel() {
105                    return new ListTypeWrapper(_listType.toUnescapedModel());
106            }
107    
108            @Override
109            public boolean isCachedModel() {
110                    return _listType.isCachedModel();
111            }
112    
113            @Override
114            public boolean isEscapedModel() {
115                    return _listType.isEscapedModel();
116            }
117    
118            @Override
119            public boolean isNew() {
120                    return _listType.isNew();
121            }
122    
123            @Override
124            public ExpandoBridge getExpandoBridge() {
125                    return _listType.getExpandoBridge();
126            }
127    
128            @Override
129            public int compareTo(ListType listType) {
130                    return _listType.compareTo(listType);
131            }
132    
133            @Override
134            public int hashCode() {
135                    return _listType.hashCode();
136            }
137    
138            @Override
139            public Serializable getPrimaryKeyObj() {
140                    return _listType.getPrimaryKeyObj();
141            }
142    
143            @Override
144            public java.lang.Object clone() {
145                    return new ListTypeWrapper((ListType)_listType.clone());
146            }
147    
148            /**
149            * Returns the name of this list type.
150            *
151            * @return the name of this list type
152            */
153            @Override
154            public java.lang.String getName() {
155                    return _listType.getName();
156            }
157    
158            /**
159            * Returns the type of this list type.
160            *
161            * @return the type of this list type
162            */
163            @Override
164            public java.lang.String getType() {
165                    return _listType.getType();
166            }
167    
168            @Override
169            public java.lang.String toString() {
170                    return _listType.toString();
171            }
172    
173            @Override
174            public java.lang.String toXmlString() {
175                    return _listType.toXmlString();
176            }
177    
178            /**
179            * Returns the list type ID of this list type.
180            *
181            * @return the list type ID of this list type
182            */
183            @Override
184            public long getListTypeId() {
185                    return _listType.getListTypeId();
186            }
187    
188            /**
189            * Returns the mvcc version of this list type.
190            *
191            * @return the mvcc version of this list type
192            */
193            @Override
194            public long getMvccVersion() {
195                    return _listType.getMvccVersion();
196            }
197    
198            /**
199            * Returns the primary key of this list type.
200            *
201            * @return the primary key of this list type
202            */
203            @Override
204            public long getPrimaryKey() {
205                    return _listType.getPrimaryKey();
206            }
207    
208            @Override
209            public void persist() {
210                    _listType.persist();
211            }
212    
213            @Override
214            public void setCachedModel(boolean cachedModel) {
215                    _listType.setCachedModel(cachedModel);
216            }
217    
218            @Override
219            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
220                    _listType.setExpandoBridgeAttributes(baseModel);
221            }
222    
223            @Override
224            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
225                    _listType.setExpandoBridgeAttributes(expandoBridge);
226            }
227    
228            @Override
229            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
230                    _listType.setExpandoBridgeAttributes(serviceContext);
231            }
232    
233            /**
234            * Sets the list type ID of this list type.
235            *
236            * @param listTypeId the list type ID of this list type
237            */
238            @Override
239            public void setListTypeId(long listTypeId) {
240                    _listType.setListTypeId(listTypeId);
241            }
242    
243            /**
244            * Sets the mvcc version of this list type.
245            *
246            * @param mvccVersion the mvcc version of this list type
247            */
248            @Override
249            public void setMvccVersion(long mvccVersion) {
250                    _listType.setMvccVersion(mvccVersion);
251            }
252    
253            /**
254            * Sets the name of this list type.
255            *
256            * @param name the name of this list type
257            */
258            @Override
259            public void setName(java.lang.String name) {
260                    _listType.setName(name);
261            }
262    
263            @Override
264            public void setNew(boolean n) {
265                    _listType.setNew(n);
266            }
267    
268            /**
269            * Sets the primary key of this list type.
270            *
271            * @param primaryKey the primary key of this list type
272            */
273            @Override
274            public void setPrimaryKey(long primaryKey) {
275                    _listType.setPrimaryKey(primaryKey);
276            }
277    
278            @Override
279            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
280                    _listType.setPrimaryKeyObj(primaryKeyObj);
281            }
282    
283            /**
284            * Sets the type of this list type.
285            *
286            * @param type the type of this list type
287            */
288            @Override
289            public void setType(java.lang.String type) {
290                    _listType.setType(type);
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 (Objects.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    }