]>
git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/attachment/SimpleAttachment.java
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 SimpleAttachment() {
13 public SimpleAttachment(String uuid
, String name
, String contentType
) {
17 this.contentType
= contentType
;
20 public String
getUuid() {
24 public void setUuid(String uuid
) {
28 public String
getName() {
32 public void setName(String name
) {
36 public String
getContentType() {
40 public void setContentType(String contentType
) {
41 this.contentType
= contentType
;
44 public String
toString() {
45 return "Attachment #" + uuid
+ "(" + name
+ ", " + contentType
+ ")";
48 public boolean equals(Object obj
) {
49 if (obj
instanceof Attachment
) {
50 Attachment attachment
= (Attachment
) obj
;
51 if (uuid
!= null && attachment
.getUuid() != null)
52 return uuid
.equals(attachment
.getUuid());
54 if (name
!= null && attachment
.getName() != null)
55 return name
.equals(attachment
.getName());
57 return hashCode() == attachment
.hashCode();