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