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