mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 09:08:02 +01:00
Clean up null-ability of incoming message entity fields
This commit is contained in:
@@ -10,16 +10,16 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
public class IncomingMessage {
|
||||
|
||||
@JsonProperty
|
||||
private int type;
|
||||
private final int type;
|
||||
|
||||
@JsonProperty
|
||||
private final String destination;
|
||||
|
||||
@JsonProperty
|
||||
private long destinationDeviceId;
|
||||
private final long destinationDeviceId;
|
||||
|
||||
@JsonProperty
|
||||
private int destinationRegistrationId;
|
||||
private final int destinationRegistrationId;
|
||||
|
||||
@JsonProperty
|
||||
private final String body;
|
||||
@@ -35,31 +35,20 @@ public class IncomingMessage {
|
||||
|
||||
@JsonCreator
|
||||
public IncomingMessage(
|
||||
@JsonProperty("id") final Integer type,
|
||||
@JsonProperty("id") final int type,
|
||||
@JsonProperty("destination") final String destination,
|
||||
@JsonProperty("destinationDeviceId") final Long destinationDeviceId,
|
||||
@JsonProperty("destinationRegistrationId") final Integer destinationRegistrationId,
|
||||
@JsonProperty("destinationDeviceId") final long destinationDeviceId,
|
||||
@JsonProperty("destinationRegistrationId") final int destinationRegistrationId,
|
||||
@JsonProperty("body") final String body,
|
||||
@JsonProperty("content") final String content,
|
||||
@JsonProperty("relay") final String relay,
|
||||
@JsonProperty("timestamp") final Long timestamp) {
|
||||
if (type != null) {
|
||||
this.type = type;
|
||||
}
|
||||
@JsonProperty("relay") final String relay) {
|
||||
this.type = type;
|
||||
this.destination = destination;
|
||||
|
||||
if (destinationDeviceId != null) {
|
||||
this.destinationDeviceId = destinationDeviceId;
|
||||
}
|
||||
if (destinationRegistrationId != null) {
|
||||
this.destinationRegistrationId = destinationRegistrationId;
|
||||
}
|
||||
this.destinationDeviceId = destinationDeviceId;
|
||||
this.destinationRegistrationId = destinationRegistrationId;
|
||||
this.body = body;
|
||||
this.content = content;
|
||||
this.relay = relay;
|
||||
if (timestamp != null) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDestination() {
|
||||
|
||||
@@ -18,23 +18,19 @@ public class IncomingMessageList {
|
||||
private final List<@NotNull IncomingMessage> messages;
|
||||
|
||||
@JsonProperty
|
||||
private long timestamp;
|
||||
private final long timestamp;
|
||||
|
||||
@JsonProperty
|
||||
private boolean online;
|
||||
private final boolean online;
|
||||
|
||||
@JsonCreator
|
||||
public IncomingMessageList(
|
||||
@JsonProperty("messages") final List<@NotNull IncomingMessage> messages,
|
||||
@JsonProperty("online") final Boolean online,
|
||||
@JsonProperty("timestamp") final Long timestamp) {
|
||||
@JsonProperty("online") final boolean online,
|
||||
@JsonProperty("timestamp") final long timestamp) {
|
||||
this.messages = messages;
|
||||
if (timestamp != null) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
if (online != null) {
|
||||
this.online = online;
|
||||
}
|
||||
this.timestamp = timestamp;
|
||||
this.online = online;
|
||||
}
|
||||
|
||||
public List<IncomingMessage> getMessages() {
|
||||
|
||||
Reference in New Issue
Block a user