Download this file

Resource.java    90 lines (73 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package risks;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
/**
* Created by miguel on 24-06-2014.
*/
@XmlRootElement(name="resource")
@XmlAccessorType(XmlAccessType.FIELD)
public class Resource {
private String id;
private String name;
private String type;
private List<String> dependOn;
private String contextModelURI;
public Resource(String id, String name, String type, ArrayList<String> dependOn, String contextModelURI) {
this.id = id;
this.name = name;
this.type = type;
this.dependOn = dependOn;
this.contextModelURI = contextModelURI;
}
public Resource() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getContextModelURI() {
return contextModelURI;
}
public void setContextModelURI(String contextModelURI) {
this.contextModelURI = contextModelURI;
}
@Override
public boolean equals(Object obj) {
if (obj.getClass() == this.getClass()) {
Resource r = (Resource) obj;
if (!r.getId().equals(this.id))
return false;
if(!r.getContextModelURI().equals(contextModelURI))
return false;
if(!r.getName().equals(name))
return false;
if(!r.getType().equals(type))
return false;
} else
return false;
return true;
}
public List<String> getDependOn() {
return dependOn;
}
public void setDependOn(ArrayList<String> dependOn) {
this.dependOn = dependOn;
}
}