Project

General

Profile

1
package eu.dnetlib.openaire.directindex.api;
2

    
3
import java.util.Objects;
4

    
5
public class IndexDsInfo {
6

    
7
    private final String indexBaseUrl;
8
    private final String indexDsId;
9
    private final String format;
10
    private final String coll;
11

    
12
    public IndexDsInfo(final String indexBaseUrl, final String indexDsId, final String format, final String coll) {
13
        this.indexBaseUrl = indexBaseUrl;
14
        this.indexDsId = indexDsId;
15
        this.format = format;
16
        this.coll = coll;
17
    }
18

    
19
    public String getIndexBaseUrl() {
20
        return indexBaseUrl;
21
    }
22

    
23
    public String getIndexDsId() {
24
        return indexDsId;
25
    }
26

    
27
    public String getFormat() {
28
        return format;
29
    }
30

    
31
    public String getColl() {
32
        return coll;
33
    }
34

    
35
    @Override
36
    public int hashCode() {
37
        return getIndexBaseUrl().hashCode() + getColl().hashCode();
38
    }
39

    
40
    @Override
41
    public boolean equals(Object other) {
42
        if (!(other instanceof IndexDsInfo)) return false;
43

    
44
        return Objects.equals(getIndexBaseUrl(), ((IndexDsInfo) other).getIndexBaseUrl()) &&
45
                Objects.equals(getIndexDsId(), ((IndexDsInfo) other).getIndexDsId()) &&
46
                Objects.equals(getFormat(), ((IndexDsInfo) other).getFormat()) &&
47
                Objects.equals(getColl(), ((IndexDsInfo) other).getColl());
48
    }
49
}
(3-3/7)