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