1
|
package eu.dnetlib.data.mdstore.plugins.objects;
|
2
|
|
3
|
import javax.xml.bind.annotation.XmlAccessType;
|
4
|
import javax.xml.bind.annotation.XmlAccessorType;
|
5
|
import javax.xml.bind.annotation.XmlAttribute;
|
6
|
import javax.xml.bind.annotation.XmlValue;
|
7
|
|
8
|
@XmlAccessorType(XmlAccessType.FIELD)
|
9
|
public class MyURL {
|
10
|
|
11
|
@XmlValue
|
12
|
private String url;
|
13
|
|
14
|
@XmlAttribute(name = "hostedBy")
|
15
|
private String hostedBy;
|
16
|
|
17
|
@XmlAttribute(name = "rights")
|
18
|
private String rights;
|
19
|
|
20
|
public MyURL() {}
|
21
|
|
22
|
public MyURL(final String url, final String hostedBy, final String rights) {
|
23
|
this.url = url;
|
24
|
this.hostedBy = hostedBy;
|
25
|
this.rights = rights;
|
26
|
}
|
27
|
|
28
|
public String getUrl() {
|
29
|
return url;
|
30
|
}
|
31
|
|
32
|
public String getHostedBy() {
|
33
|
return hostedBy;
|
34
|
}
|
35
|
|
36
|
public String getRights() {
|
37
|
return rights;
|
38
|
}
|
39
|
|
40
|
public void setUrl(final String url) {
|
41
|
this.url = url;
|
42
|
}
|
43
|
|
44
|
public void setHostedBy(final String hostedBy) {
|
45
|
this.hostedBy = hostedBy;
|
46
|
}
|
47
|
|
48
|
public void setRights(final String rights) {
|
49
|
this.rights = rights;
|
50
|
}
|
51
|
|
52
|
@Override
|
53
|
public int hashCode() {
|
54
|
return url.replaceAll("https://", "http://").hashCode();
|
55
|
}
|
56
|
|
57
|
@Override
|
58
|
public boolean equals(final Object obj) {
|
59
|
if ((obj != null) && (obj instanceof MyURL)) {
|
60
|
final String url1 = url.replaceAll("https://", "http://");
|
61
|
final String url2 = ((MyURL) obj).getUrl().replaceAll("https://", "http://");
|
62
|
return url1.equals(url2);
|
63
|
}
|
64
|
return false;
|
65
|
}
|
66
|
}
|