]>
git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/attachment/SimpleAttachment.java
1c1f13eb9319ec98b8157c87a0166757b780efcc
1 package org
.argeo
.slc
.core
.attachment
;
5 public class SimpleAttachment
implements Attachment
{
6 private String uuid
= UUID
.randomUUID().toString();
8 private String contentType
= "";
10 public String
getUuid() {
14 public void setUuid(String uuid
) {
18 public String
getName() {
22 public void setName(String name
) {
26 public String
getContentType() {
30 public void setContentType(String contentType
) {
31 this.contentType
= contentType
;
34 public String
toString() {
35 return "Attachment #" + uuid
+ "(" + name
+ ", " + contentType
+ ")";
38 public boolean equals(Object obj
) {
39 if (obj
instanceof Attachment
) {
40 Attachment attachment
= (Attachment
) obj
;
41 if (uuid
!= null && attachment
.getUuid() != null)
42 return uuid
.equals(attachment
.getUuid());
44 if (name
!= null && attachment
.getName() != null)
45 return name
.equals(attachment
.getName());
47 return hashCode() == attachment
.hashCode();