1
|
package eu.dnetlib.pace.model.gt;
|
2
|
|
3
|
import java.util.List;
|
4
|
|
5
|
import com.google.common.collect.ComparisonChain;
|
6
|
import com.google.common.collect.Ordering;
|
7
|
import com.google.gson.Gson;
|
8
|
|
9
|
public class Result implements Comparable<Result> {
|
10
|
|
11
|
private String id;
|
12
|
private String title;
|
13
|
private List<Author> authors;
|
14
|
|
15
|
private double meanDistance;
|
16
|
|
17
|
public Result() {}
|
18
|
|
19
|
public String getId() {
|
20
|
return id;
|
21
|
}
|
22
|
|
23
|
public void setId(final String id) {
|
24
|
this.id = id;
|
25
|
}
|
26
|
|
27
|
public String getTitle() {
|
28
|
return title;
|
29
|
}
|
30
|
|
31
|
public void setTitle(final String title) {
|
32
|
this.title = title;
|
33
|
}
|
34
|
|
35
|
public List<Author> getAuthors() {
|
36
|
return authors;
|
37
|
}
|
38
|
|
39
|
public void setAuthors(final List<Author> authors) {
|
40
|
this.authors = authors;
|
41
|
}
|
42
|
|
43
|
@Override
|
44
|
public String toString() {
|
45
|
return new Gson().toJson(this);
|
46
|
}
|
47
|
|
48
|
@Override
|
49
|
public int compareTo(final Result o) {
|
50
|
return ComparisonChain.start()
|
51
|
.compare(this.getAuthors().size(), o.getAuthors().size(), Ordering.natural().nullsLast())
|
52
|
.result();
|
53
|
}
|
54
|
|
55
|
public double getMeanDistance() {
|
56
|
return meanDistance;
|
57
|
}
|
58
|
|
59
|
public void setMeanDistance(final double meanDistance) {
|
60
|
this.meanDistance = meanDistance;
|
61
|
}
|
62
|
|
63
|
}
|