001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.util.Validator;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link ClassName}.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see ClassName
029     * @generated
030     */
031    public class ClassNameWrapper implements ClassName, ModelWrapper<ClassName> {
032            public ClassNameWrapper(ClassName className) {
033                    _className = className;
034            }
035    
036            @Override
037            public Class<?> getModelClass() {
038                    return ClassName.class;
039            }
040    
041            @Override
042            public String getModelClassName() {
043                    return ClassName.class.getName();
044            }
045    
046            @Override
047            public Map<String, Object> getModelAttributes() {
048                    Map<String, Object> attributes = new HashMap<String, Object>();
049    
050                    attributes.put("classNameId", getClassNameId());
051                    attributes.put("value", getValue());
052    
053                    return attributes;
054            }
055    
056            @Override
057            public void setModelAttributes(Map<String, Object> attributes) {
058                    Long classNameId = (Long)attributes.get("classNameId");
059    
060                    if (classNameId != null) {
061                            setClassNameId(classNameId);
062                    }
063    
064                    String value = (String)attributes.get("value");
065    
066                    if (value != null) {
067                            setValue(value);
068                    }
069            }
070    
071            /**
072            * Returns the primary key of this class name.
073            *
074            * @return the primary key of this class name
075            */
076            @Override
077            public long getPrimaryKey() {
078                    return _className.getPrimaryKey();
079            }
080    
081            /**
082            * Sets the primary key of this class name.
083            *
084            * @param primaryKey the primary key of this class name
085            */
086            @Override
087            public void setPrimaryKey(long primaryKey) {
088                    _className.setPrimaryKey(primaryKey);
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            @Override
102            public void setClassName(java.lang.String className) {
103                    _className.setClassName(className);
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            /**
117            * Sets the class name ID of this class name.
118            *
119            * @param classNameId the class name ID of this class name
120            */
121            @Override
122            public void setClassNameId(long classNameId) {
123                    _className.setClassNameId(classNameId);
124            }
125    
126            /**
127            * Returns the value of this class name.
128            *
129            * @return the value of this class name
130            */
131            @Override
132            public java.lang.String getValue() {
133                    return _className.getValue();
134            }
135    
136            /**
137            * Sets the value of this class name.
138            *
139            * @param value the value of this class name
140            */
141            @Override
142            public void setValue(java.lang.String value) {
143                    _className.setValue(value);
144            }
145    
146            @Override
147            public boolean isNew() {
148                    return _className.isNew();
149            }
150    
151            @Override
152            public void setNew(boolean n) {
153                    _className.setNew(n);
154            }
155    
156            @Override
157            public boolean isCachedModel() {
158                    return _className.isCachedModel();
159            }
160    
161            @Override
162            public void setCachedModel(boolean cachedModel) {
163                    _className.setCachedModel(cachedModel);
164            }
165    
166            @Override
167            public boolean isEscapedModel() {
168                    return _className.isEscapedModel();
169            }
170    
171            @Override
172            public java.io.Serializable getPrimaryKeyObj() {
173                    return _className.getPrimaryKeyObj();
174            }
175    
176            @Override
177            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
178                    _className.setPrimaryKeyObj(primaryKeyObj);
179            }
180    
181            @Override
182            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
183                    return _className.getExpandoBridge();
184            }
185    
186            @Override
187            public void setExpandoBridgeAttributes(
188                    com.liferay.portal.model.BaseModel<?> baseModel) {
189                    _className.setExpandoBridgeAttributes(baseModel);
190            }
191    
192            @Override
193            public void setExpandoBridgeAttributes(
194                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
195                    _className.setExpandoBridgeAttributes(expandoBridge);
196            }
197    
198            @Override
199            public void setExpandoBridgeAttributes(
200                    com.liferay.portal.service.ServiceContext serviceContext) {
201                    _className.setExpandoBridgeAttributes(serviceContext);
202            }
203    
204            @Override
205            public java.lang.Object clone() {
206                    return new ClassNameWrapper((ClassName)_className.clone());
207            }
208    
209            @Override
210            public int compareTo(com.liferay.portal.model.ClassName className) {
211                    return _className.compareTo(className);
212            }
213    
214            @Override
215            public int hashCode() {
216                    return _className.hashCode();
217            }
218    
219            @Override
220            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ClassName> toCacheModel() {
221                    return _className.toCacheModel();
222            }
223    
224            @Override
225            public com.liferay.portal.model.ClassName toEscapedModel() {
226                    return new ClassNameWrapper(_className.toEscapedModel());
227            }
228    
229            @Override
230            public com.liferay.portal.model.ClassName toUnescapedModel() {
231                    return new ClassNameWrapper(_className.toUnescapedModel());
232            }
233    
234            @Override
235            public java.lang.String toString() {
236                    return _className.toString();
237            }
238    
239            @Override
240            public java.lang.String toXmlString() {
241                    return _className.toXmlString();
242            }
243    
244            @Override
245            public void persist()
246                    throws com.liferay.portal.kernel.exception.SystemException {
247                    _className.persist();
248            }
249    
250            @Override
251            public boolean equals(Object obj) {
252                    if (this == obj) {
253                            return true;
254                    }
255    
256                    if (!(obj instanceof ClassNameWrapper)) {
257                            return false;
258                    }
259    
260                    ClassNameWrapper classNameWrapper = (ClassNameWrapper)obj;
261    
262                    if (Validator.equals(_className, classNameWrapper._className)) {
263                            return true;
264                    }
265    
266                    return false;
267            }
268    
269            /**
270             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
271             */
272            public ClassName getWrappedClassName() {
273                    return _className;
274            }
275    
276            @Override
277            public ClassName getWrappedModel() {
278                    return _className;
279            }
280    
281            @Override
282            public void resetOriginalValues() {
283                    _className.resetOriginalValues();
284            }
285    
286            private ClassName _className;
287    }