1 16 package com.blandware.atleap.model.core; 17 18 import java.util.ArrayList ; 19 import java.util.HashMap ; 20 import java.util.List ; 21 import java.util.Map ; 22 import java.util.Iterator ; 23 24 50 public class ContentLocale extends BaseObject implements Comparable { 51 52 56 protected String identifier; 57 60 protected Boolean defaultInstance; 61 64 protected Boolean active; 65 68 protected List contentFieldValues = new ArrayList (); 69 72 protected List contentDocuments = new ArrayList (); 73 76 protected List applicationResources = new ArrayList (); 77 80 protected Long version; 81 82 85 protected Map title = new HashMap (); 86 87 89 100 public String getIdentifier() { 101 return identifier; 102 } 103 104 110 public void setIdentifier(String identifier) { 111 this.identifier = identifier; 112 } 113 114 124 public Map getTitle() { 125 return title; 126 } 127 128 133 public void setTitle(Map title) { 134 this.title = title; 135 } 136 137 144 public Long getVersion() { 145 return version; 146 } 147 148 153 public void setVersion(Long version) { 154 this.version = version; 155 } 156 157 158 166 protected List getContentFieldValues() { 167 return contentFieldValues; 168 } 169 170 175 protected void setContentFieldValues(List contentFieldValues) { 176 this.contentFieldValues = contentFieldValues; 177 } 178 179 187 protected List getContentDocuments() { 188 return contentDocuments; 189 } 190 191 196 protected void setContentDocuments(List contentDocuments) { 197 this.contentDocuments = contentDocuments; 198 } 199 200 208 protected List getApplicationResources() { 209 return applicationResources; 210 } 211 212 217 protected void setApplicationResources(List applicationResources) { 218 this.applicationResources = applicationResources; 219 } 220 221 227 public Boolean getDefaultInstance() { 228 return defaultInstance; 229 } 230 231 236 public void setDefaultInstance(Boolean defaultInstance) { 237 this.defaultInstance = defaultInstance; 238 } 239 240 247 public Boolean getActive() { 248 return active; 249 } 250 251 256 public boolean isActive() { 257 return active.booleanValue(); 258 } 259 260 265 public void setActive(Boolean active) { 266 this.active = active; 267 } 268 269 public boolean equals(Object o) { 270 if ( this == o ) { 271 return true; 272 } 273 if ( !(o instanceof ContentLocale) ) { 274 return false; 275 } 276 277 final ContentLocale contentLocale = (ContentLocale) o; 278 279 if ( identifier != null ? !identifier.equals(contentLocale.identifier) : contentLocale.identifier != null ) { 280 return false; 281 } 282 283 return true; 284 } 285 286 public int hashCode() { 287 return (identifier != null ? identifier.hashCode() : 0); 288 } 289 290 298 public int compareTo(Object o) { 299 if ( o instanceof ContentLocale ) { 300 ContentLocale locale = (ContentLocale) o; 301 return this.identifier.compareToIgnoreCase(locale.getIdentifier()); 302 } else { 303 throw new ClassCastException ("Cannot compare instance of " + getClass().getName() + " to the instance of " + o.getClass().getName()); 304 } 305 } 306 307 312 public ContentLocale shallowCopy() { 313 ContentLocale locale = new ContentLocale(); 314 locale.setIdentifier(this.identifier); 315 Map title = new HashMap (); 317 for ( Iterator i = this.title.entrySet().iterator(); i.hasNext(); ) { 318 Map.Entry entry = (Map.Entry ) i.next(); 319 String key = (String ) entry.getKey(); 320 String value = (String ) entry.getValue(); 321 title.put(key, value); 322 } 323 locale.setTitle(title); 324 locale.setActive(this.active); 325 locale.setDefaultInstance(this.defaultInstance); 326 locale.setVersion(this.version); 327 return locale; 328 } 329 } 330 | Popular Tags |