Convert `DeviceInfo` and `DeviceInfoList` to a record
This commit is contained in:
parent
a96ee57c7e
commit
8b13826949
|
@ -5,25 +5,5 @@
|
|||
|
||||
package org.whispersystems.textsecuregcm.entities;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class DeviceInfo {
|
||||
@JsonProperty
|
||||
private long id;
|
||||
|
||||
@JsonProperty
|
||||
private String name;
|
||||
|
||||
@JsonProperty
|
||||
private long lastSeen;
|
||||
|
||||
@JsonProperty
|
||||
private long created;
|
||||
|
||||
public DeviceInfo(long id, String name, long lastSeen, long created) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.lastSeen = lastSeen;
|
||||
this.created = created;
|
||||
}
|
||||
public record DeviceInfo(long id, String name, long lastSeen, long created) {
|
||||
}
|
||||
|
|
|
@ -5,16 +5,7 @@
|
|||
|
||||
package org.whispersystems.textsecuregcm.entities;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DeviceInfoList {
|
||||
|
||||
@JsonProperty
|
||||
private List<DeviceInfo> devices;
|
||||
|
||||
public DeviceInfoList(List<DeviceInfo> devices) {
|
||||
this.devices = devices;
|
||||
}
|
||||
public record DeviceInfoList(List<DeviceInfo> devices) {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue