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