Repository navigation
Expand file tree
/
Copy pathAdvice.java
More file actions
68 lines (57 loc) · 1.68 KB
/
Copy pathAdvice.java
File metadata and controls
68 lines (57 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package io.getstream.core.faye;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.common.base.MoreObjects;
import java.util.Objects;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Advice {
private final String reconnect;
private final Integer interval;
private final Integer timeout;
public static final String NONE = "none";
public static final String HANDSHAKE = "handshake";
public static final String RETRY = "retry";
// for deserialization
public Advice() {
reconnect = null;
interval = null;
timeout = null;
}
public Advice(String reconnect, Integer interval, Integer timeout) {
this.reconnect = reconnect;
this.interval = interval;
this.timeout = timeout;
}
public String getReconnect() {
return reconnect;
}
public Integer getInterval() {
return interval;
}
public Integer getTimeout() {
return timeout;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Advice that = (Advice) o;
return Objects.equals(reconnect, that.reconnect)
&& Objects.equals(interval, that.interval)
&& Objects.equals(timeout, that.timeout);
}
@Override
public int hashCode() {
return Objects.hash(reconnect, interval, timeout);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.omitNullValues()
.add("reconnect", this.reconnect)
.add("interval", this.interval)
.add("timeout", this.timeout)
.toString();
}
}