]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.spring/src/org/argeo/slc/core/attachment/SimpleAttachment.java
1 package org
.argeo
.slc
.core
.attachment
;
3 import java
.io
.Serializable
;
6 import org
.argeo
.slc
.attachment
.Attachment
;
8 public class SimpleAttachment
implements Attachment
, Serializable
{
9 private static final long serialVersionUID
= 6615155908800610606L;
10 private String uuid
= UUID
.randomUUID().toString();
12 private String contentType
= "";
14 public SimpleAttachment() {
17 public SimpleAttachment(String uuid
, String name
, String contentType
) {
21 this.contentType
= contentType
;
24 public String
getUuid() {
28 public void setUuid(String uuid
) {
32 public String
getName() {
36 public void setName(String name
) {
40 public String
getContentType() {
44 public void setContentType(String contentType
) {
45 this.contentType
= contentType
;
48 public String
toString() {
49 return "Attachment #" + uuid
+ "(" + name
+ ", " + contentType
+ ")";
52 public boolean equals(Object obj
) {
53 if (obj
instanceof Attachment
) {
54 Attachment attachment
= (Attachment
) obj
;
55 if (uuid
!= null && attachment
.getUuid() != null)
56 return uuid
.equals(attachment
.getUuid());
58 if (name
!= null && attachment
.getName() != null)
59 return name
.equals(attachment
.getName());
61 return hashCode() == attachment
.hashCode();