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    import com.liferay.portal.kernel.util.Validator;
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 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 java.lang.Object clone() {
088                    return new ClassNameWrapper((ClassName)_className.clone());
089            }
090    
091            @Override
092            public int compareTo(com.liferay.portal.kernel.model.ClassName className) {
093                    return _className.compareTo(className);
094            }
095    
096            /**
097            * Returns the fully qualified class name of this class name.
098            *
099            * @return the fully qualified class name of this class name
100            */
101            @Override
102            public java.lang.String getClassName() {
103                    return _className.getClassName();
104            }
105    
106            /**
107            * Returns the class name ID of this class name.
108            *
109            * @return the class name ID of this class name
110            */
111            @Override
112            public long getClassNameId() {
113                    return _className.getClassNameId();
114            }
115    
116            @Override
117            public ExpandoBridge getExpandoBridge() {
118                    return _className.getExpandoBridge();
119            }
120    
121            /**
122            * Returns the mvcc version of this class name.
123            *
124            * @return the mvcc version of this class name
125            */
126            @Override
127            public long getMvccVersion() {
128                    return _className.getMvccVersion();
129            }
130    
131            /**
132            * Returns the primary key of this class name.
133            *
134            * @return the primary key of this class name
135            */
136            @Override
137            public long getPrimaryKey() {
138                    return _className.getPrimaryKey();
139            }
140    
141            @Override
142            public Serializable getPrimaryKeyObj() {
143                    return _className.getPrimaryKeyObj();
144            }
145    
146            /**
147            * Returns the value of this class name.
148            *
149            * @return the value of this class name
150            */
151            @Override
152            public java.lang.String getValue() {
153                    return _className.getValue();
154            }
155    
156            @Override
157            public int hashCode() {
158                    return _className.hashCode();
159            }
160    
161            @Override
162            public boolean isCachedModel() {
163                    return _className.isCachedModel();
164            }
165    
166            @Override
167            public boolean isEscapedModel() {
168                    return _className.isEscapedModel();
169            }
170    
171            @Override
172            public boolean isNew() {
173                    return _className.isNew();
174            }
175    
176            @Override
177            public void persist() {
178                    _className.persist();
179            }
180    
181            @Override
182            public void setCachedModel(boolean cachedModel) {
183                    _className.setCachedModel(cachedModel);
184            }
185    
186            @Override
187            public void setClassName(java.lang.String className) {
188                    _className.setClassName(className);
189            }
190    
191            /**
192            * Sets the class name ID of this class name.
193            *
194            * @param classNameId the class name ID of this class name
195            */
196            @Override
197            public void setClassNameId(long classNameId) {
198                    _className.setClassNameId(classNameId);
199            }
200    
201            @Override
202            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
203                    _className.setExpandoBridgeAttributes(baseModel);
204            }
205    
206            @Override
207            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
208                    _className.setExpandoBridgeAttributes(expandoBridge);
209            }
210    
211            @Override
212            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
213                    _className.setExpandoBridgeAttributes(serviceContext);
214            }
215    
216            /**
217            * Sets the mvcc version of this class name.
218            *
219            * @param mvccVersion the mvcc version of this class name
220            */
221            @Override
222            public void setMvccVersion(long mvccVersion) {
223                    _className.setMvccVersion(mvccVersion);
224            }
225    
226            @Override
227            public void setNew(boolean n) {
228                    _className.setNew(n);
229            }
230    
231            /**
232            * Sets the primary key of this class name.
233            *
234            * @param primaryKey the primary key of this class name
235            */
236            @Override
237            public void setPrimaryKey(long primaryKey) {
238                    _className.setPrimaryKey(primaryKey);
239            }
240    
241            @Override
242            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
243                    _className.setPrimaryKeyObj(primaryKeyObj);
244            }
245    
246            /**
247            * Sets the value of this class name.
248            *
249            * @param value the value of this class name
250            */
251            @Override
252            public void setValue(java.lang.String value) {
253                    _className.setValue(value);
254            }
255    
256            @Override
257            public CacheModel<com.liferay.portal.kernel.model.ClassName> toCacheModel() {
258                    return _className.toCacheModel();
259            }
260    
261            @Override
262            public com.liferay.portal.kernel.model.ClassName toEscapedModel() {
263                    return new ClassNameWrapper(_className.toEscapedModel());
264            }
265    
266            @Override
267            public java.lang.String toString() {
268                    return _className.toString();
269            }
270    
271            @Override
272            public com.liferay.portal.kernel.model.ClassName toUnescapedModel() {
273                    return new ClassNameWrapper(_className.toUnescapedModel());
274            }
275    
276            @Override
277            public java.lang.String toXmlString() {
278                    return _className.toXmlString();
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 (Validator.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    }