001
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
031 public class RegionWrapper implements Region, ModelWrapper<Region> {
032 public RegionWrapper(Region region) {
033 _region = region;
034 }
035
036 public Class<?> getModelClass() {
037 return Region.class;
038 }
039
040 public String getModelClassName() {
041 return Region.class.getName();
042 }
043
044 public Map<String, Object> getModelAttributes() {
045 Map<String, Object> attributes = new HashMap<String, Object>();
046
047 attributes.put("regionId", getRegionId());
048 attributes.put("countryId", getCountryId());
049 attributes.put("regionCode", getRegionCode());
050 attributes.put("name", getName());
051 attributes.put("active", getActive());
052
053 return attributes;
054 }
055
056 public void setModelAttributes(Map<String, Object> attributes) {
057 Long regionId = (Long)attributes.get("regionId");
058
059 if (regionId != null) {
060 setRegionId(regionId);
061 }
062
063 Long countryId = (Long)attributes.get("countryId");
064
065 if (countryId != null) {
066 setCountryId(countryId);
067 }
068
069 String regionCode = (String)attributes.get("regionCode");
070
071 if (regionCode != null) {
072 setRegionCode(regionCode);
073 }
074
075 String name = (String)attributes.get("name");
076
077 if (name != null) {
078 setName(name);
079 }
080
081 Boolean active = (Boolean)attributes.get("active");
082
083 if (active != null) {
084 setActive(active);
085 }
086 }
087
088
093 public long getPrimaryKey() {
094 return _region.getPrimaryKey();
095 }
096
097
102 public void setPrimaryKey(long primaryKey) {
103 _region.setPrimaryKey(primaryKey);
104 }
105
106
111 public long getRegionId() {
112 return _region.getRegionId();
113 }
114
115
120 public void setRegionId(long regionId) {
121 _region.setRegionId(regionId);
122 }
123
124
129 public long getCountryId() {
130 return _region.getCountryId();
131 }
132
133
138 public void setCountryId(long countryId) {
139 _region.setCountryId(countryId);
140 }
141
142
147 public java.lang.String getRegionCode() {
148 return _region.getRegionCode();
149 }
150
151
156 public void setRegionCode(java.lang.String regionCode) {
157 _region.setRegionCode(regionCode);
158 }
159
160
165 public java.lang.String getName() {
166 return _region.getName();
167 }
168
169
174 public void setName(java.lang.String name) {
175 _region.setName(name);
176 }
177
178
183 public boolean getActive() {
184 return _region.getActive();
185 }
186
187
192 public boolean isActive() {
193 return _region.isActive();
194 }
195
196
201 public void setActive(boolean active) {
202 _region.setActive(active);
203 }
204
205 public boolean isNew() {
206 return _region.isNew();
207 }
208
209 public void setNew(boolean n) {
210 _region.setNew(n);
211 }
212
213 public boolean isCachedModel() {
214 return _region.isCachedModel();
215 }
216
217 public void setCachedModel(boolean cachedModel) {
218 _region.setCachedModel(cachedModel);
219 }
220
221 public boolean isEscapedModel() {
222 return _region.isEscapedModel();
223 }
224
225 public java.io.Serializable getPrimaryKeyObj() {
226 return _region.getPrimaryKeyObj();
227 }
228
229 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
230 _region.setPrimaryKeyObj(primaryKeyObj);
231 }
232
233 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
234 return _region.getExpandoBridge();
235 }
236
237 public void setExpandoBridgeAttributes(
238 com.liferay.portal.service.ServiceContext serviceContext) {
239 _region.setExpandoBridgeAttributes(serviceContext);
240 }
241
242 @Override
243 public java.lang.Object clone() {
244 return new RegionWrapper((Region)_region.clone());
245 }
246
247 public int compareTo(com.liferay.portal.model.Region region) {
248 return _region.compareTo(region);
249 }
250
251 @Override
252 public int hashCode() {
253 return _region.hashCode();
254 }
255
256 public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Region> toCacheModel() {
257 return _region.toCacheModel();
258 }
259
260 public com.liferay.portal.model.Region toEscapedModel() {
261 return new RegionWrapper(_region.toEscapedModel());
262 }
263
264 public com.liferay.portal.model.Region toUnescapedModel() {
265 return new RegionWrapper(_region.toUnescapedModel());
266 }
267
268 @Override
269 public java.lang.String toString() {
270 return _region.toString();
271 }
272
273 public java.lang.String toXmlString() {
274 return _region.toXmlString();
275 }
276
277 @Override
278 public boolean equals(Object obj) {
279 if (this == obj) {
280 return true;
281 }
282
283 if (!(obj instanceof RegionWrapper)) {
284 return false;
285 }
286
287 RegionWrapper regionWrapper = (RegionWrapper)obj;
288
289 if (Validator.equals(_region, regionWrapper._region)) {
290 return true;
291 }
292
293 return false;
294 }
295
296
299 public Region getWrappedRegion() {
300 return _region;
301 }
302
303 public Region getWrappedModel() {
304 return _region;
305 }
306
307 public void resetOriginalValues() {
308 _region.resetOriginalValues();
309 }
310
311 private Region _region;
312 }