1 16 package com.blandware.atleap.model.core; 17 18 import java.util.ArrayList ; 19 import java.util.Date ; 20 import java.util.List ; 21 22 41 public class ContentFieldValue extends BaseObject { 42 44 47 protected Long id; 48 51 protected ContentLocale contentLocale; 52 55 protected byte[] value; 56 59 protected String simpleValue; 60 63 protected ContentField contentField; 64 67 protected Date lastUpdatedDatetime = null; 68 71 protected Long version; 72 73 76 protected List linkedPages = new ArrayList (); 77 80 protected List linkedResources = new ArrayList (); 81 82 91 public Long getId() { 92 return id; 93 } 94 95 100 public void setId(Long id) { 101 this.id = id; 102 } 103 104 111 public ContentLocale getContentLocale() { 112 return contentLocale; 113 } 114 115 120 public void setContentLocale(ContentLocale contentLocale) { 121 this.contentLocale = contentLocale; 122 } 123 124 132 public String getSimpleValue() { 133 return simpleValue; 134 } 135 136 141 public void setSimpleValue(String simpleValue) { 142 this.simpleValue = simpleValue; 143 } 144 145 151 public ContentField getContentField() { 152 return contentField; 153 } 154 155 160 public void setContentField(ContentField contentField) { 161 this.contentField = contentField; 162 } 163 164 171 public Date getLastUpdatedDatetime() { 172 return lastUpdatedDatetime; 173 } 174 175 180 public void setLastUpdatedDatetime(Date lastUpdatedDatetime) { 181 this.lastUpdatedDatetime = lastUpdatedDatetime; 182 } 183 184 191 public Long getVersion() { 192 return version; 193 } 194 195 200 public void setVersion(Long version) { 201 this.version = version; 202 } 203 204 212 public List getLinkedPages() { 213 return linkedPages; 214 } 215 216 221 public void setLinkedPages(List linkedPages) { 222 this.linkedPages = linkedPages; 223 } 224 225 230 public void addLinkedPage(Page page) { 231 if ( !page.getLinkedContentFieldValues().contains(this) ) { 232 page.getLinkedContentFieldValues().add(this); 233 } 234 if ( !getLinkedPages().contains(page) ) { 235 getLinkedPages().add(page); 236 } 237 } 238 239 244 public void removeLinkedPage(Page page) { 245 page.getLinkedContentFieldValues().remove(this); 246 getLinkedPages().remove(page); 247 } 248 249 257 public List getLinkedResources() { 258 return linkedResources; 259 } 260 261 266 public void setLinkedResources(List linkedResources) { 267 this.linkedResources = linkedResources; 268 } 269 270 275 public void addLinkedResource(ContentResource resource) { 276 if ( !resource.getLinkedContentFieldValues().contains(this) ) { 277 resource.getLinkedContentFieldValues().add(this); 278 } 279 if ( !getLinkedPages().contains(resource) ) { 280 getLinkedPages().add(resource); 281 } 282 } 283 284 289 public void removeLinkedResource(ContentResource resource) { 290 resource.getLinkedContentFieldValues().remove(this); 291 getLinkedResources().remove(resource); 292 } 293 294 302 public byte[] getValue() { 303 return value; 304 } 305 306 311 public void setValue(byte[] value) { 312 this.value = value; 313 } 314 315 public boolean equals(Object o) { 316 if ( this == o ) { 317 return true; 318 } 319 if ( !(o instanceof ContentFieldValue) ) { 320 return false; 321 } 322 323 final ContentFieldValue contentFieldValue = (ContentFieldValue) o; 324 325 if ( contentField != null ? !contentField.equals(contentFieldValue.contentField) : contentFieldValue.contentField != null ) { 326 return false; 327 } 328 if ( contentLocale != null ? !contentLocale.equals(contentFieldValue.contentLocale) : contentFieldValue.contentLocale != null ) { 329 return false; 330 } 331 332 return true; 333 } 334 335 public int hashCode() { 336 int result; 337 result = (contentLocale != null ? contentLocale.hashCode() : 0); 338 result = 29 * result + (contentField != null ? contentField.hashCode() : 0); 339 return result; 340 } 341 342 } 343 | Popular Tags |