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