1
|
package eu.dnetlib.datasource.publisher.model.db;
|
2
|
|
3
|
import java.io.Serializable;
|
4
|
import java.util.Objects;
|
5
|
import javax.persistence.Embeddable;
|
6
|
|
7
|
import com.google.common.collect.ComparisonChain;
|
8
|
|
9
|
/**
|
10
|
* Created by claudio on 13/04/2017.
|
11
|
*/
|
12
|
@Embeddable
|
13
|
public class ApiParamKey implements Serializable {
|
14
|
|
15
|
private String param;
|
16
|
|
17
|
private String value;
|
18
|
|
19
|
public String getParam() {
|
20
|
return param;
|
21
|
}
|
22
|
|
23
|
public String getValue() {
|
24
|
return value;
|
25
|
}
|
26
|
|
27
|
public ApiParamKey setParam(final String param) {
|
28
|
this.param = param;
|
29
|
return this;
|
30
|
}
|
31
|
|
32
|
public ApiParamKey setValue(final String value) {
|
33
|
this.value = value;
|
34
|
return this;
|
35
|
}
|
36
|
|
37
|
@Override
|
38
|
public int hashCode() {
|
39
|
return Objects.hash(getParam(), getValue());
|
40
|
}
|
41
|
|
42
|
@Override
|
43
|
public boolean equals(final Object o) {
|
44
|
if (this == o) {
|
45
|
return true;
|
46
|
}
|
47
|
if (o == null || getClass() != o.getClass()) {
|
48
|
return false;
|
49
|
}
|
50
|
ApiParamKey apk = (ApiParamKey) o;
|
51
|
return ComparisonChain.start()
|
52
|
.compare(getParam(), apk.getParam())
|
53
|
.compare(getValue(), apk.getValue())
|
54
|
.result() == 0;
|
55
|
}
|
56
|
}
|