Project

General

Profile

1
package eu.dnetlib.domain;
2

    
3
import java.io.Serializable;
4
import java.util.Date;
5

    
6
/**
7
 * The base class for all domain objects in the driver domain. This class groups
8
 * all common information, such as the <i>resourceId</id> and the
9
 * <i>resourceUri</id>.
10
 * 
11
 */
12
public abstract class DriverResource implements Serializable {
13
	private static final long serialVersionUID = 1583061448986459014L;
14

    
15
	private String resourceId = null;
16
	private String resourceUri = null;
17
	private String resourceKind = null;
18
	private String resourceType = null;
19
	private Date dateOfCreation = null;
20

    
21
	public Date getDateOfCreation() {
22
		return dateOfCreation;
23
	}
24

    
25
	public void setDateOfCreation(Date dateOfCreation) {
26
		this.dateOfCreation = dateOfCreation;
27
	}
28

    
29
	public String getResourceId() {
30
		return resourceId;
31
	}
32

    
33
	public void setResourceId(String resourceId) {
34
		this.resourceId = resourceId;
35
	}
36

    
37
	public String getResourceKind() {
38
		return resourceKind;
39
	}
40

    
41
	public void setResourceKind(String resourceKind) {
42
		this.resourceKind = resourceKind;
43
	}
44

    
45
	public String getResourceType() {
46
		return resourceType;
47
	}
48

    
49
	public void setResourceType(String resourceType) {
50
		this.resourceType = resourceType;
51
	}
52

    
53
	public String getResourceUri() {
54
		return resourceUri;
55
	}
56

    
57
	public void setResourceUri(String resourceUri) {
58
		this.resourceUri = resourceUri;
59
	}
60

    
61
	@Override
62
	public int hashCode() {
63
		final int prime = 31;
64
		int result = 1;
65
		result = prime * result
66
				+ ((dateOfCreation == null) ? 0 : dateOfCreation.hashCode());
67
		result = prime * result
68
				+ ((resourceId == null) ? 0 : resourceId.hashCode());
69
		result = prime * result
70
				+ ((resourceKind == null) ? 0 : resourceKind.hashCode());
71
		result = prime * result
72
				+ ((resourceType == null) ? 0 : resourceType.hashCode());
73
		result = prime * result
74
				+ ((resourceUri == null) ? 0 : resourceUri.hashCode());
75
		return result;
76
	}
77

    
78
	@Override
79
	public boolean equals(Object obj) {
80
		if (this == obj)
81
			return true;
82
		if (obj == null)
83
			return false;
84
		if (getClass() != obj.getClass())
85
			return false;
86
		DriverResource other = (DriverResource) obj;
87
		if (dateOfCreation == null) {
88
			if (other.dateOfCreation != null)
89
				return false;
90
		} else if (!dateOfCreation.equals(other.dateOfCreation))
91
			return false;
92
		if (resourceId == null) {
93
			if (other.resourceId != null)
94
				return false;
95
		} else if (!resourceId.equals(other.resourceId))
96
			return false;
97
		if (resourceKind == null) {
98
			if (other.resourceKind != null)
99
				return false;
100
		} else if (!resourceKind.equals(other.resourceKind))
101
			return false;
102
		if (resourceType == null) {
103
			if (other.resourceType != null)
104
				return false;
105
		} else if (!resourceType.equals(other.resourceType))
106
			return false;
107
		if (resourceUri == null) {
108
			if (other.resourceUri != null)
109
				return false;
110
		} else if (!resourceUri.equals(other.resourceUri))
111
			return false;
112
		return true;
113
	}
114
}
(2-2/10)