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