DeviceStatusImpl.java
1.67 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
69
70
71
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.cq.screens.device.impl;
import com.adobe.cq.screens.device.DeviceStatus;
public class DeviceStatusImpl
implements DeviceStatus {
private DeviceStatus.Ping ping = PingImpl.NEVER;
private DeviceStatus.Firmware firmware = FirmwareImpl.UNKNOWN;
@Override
public DeviceStatus.Ping getLastPing() {
return this.ping;
}
public DeviceStatusImpl updatePing(long time) {
this.ping = new PingImpl(time);
return this;
}
@Override
public DeviceStatus.Firmware getFirmware() {
return this.firmware;
}
public DeviceStatusImpl updateFirmwareVersion(String version, long timestamp) {
this.firmware = new FirmwareImpl(version, timestamp);
return this;
}
public static class FirmwareImpl
implements DeviceStatus.Firmware {
static DeviceStatus.Firmware UNKNOWN = new FirmwareImpl("", 0);
private final String version;
private final long timestamp;
public FirmwareImpl(String version, long timestamp) {
this.version = version;
this.timestamp = timestamp;
}
@Override
public String getVersion() {
return this.version;
}
@Override
public long getLastUpdated() {
return this.timestamp;
}
}
public static class PingImpl
implements DeviceStatus.Ping {
static DeviceStatus.Ping NEVER = new PingImpl(0);
private final long time;
public PingImpl(long time) {
this.time = time;
}
@Override
public long getTime() {
return this.time;
}
}
}