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