Convert AccountIdentityResponse to a record

This commit is contained in:
Jon Chambers
2023-01-11 17:14:53 -05:00
committed by Jon Chambers
parent b4a143b9de
commit 5a89e66fc0
2 changed files with 16 additions and 60 deletions

View File

@@ -5,56 +5,12 @@
package org.whispersystems.textsecuregcm.entities;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Nullable;
import java.util.UUID;
import javax.annotation.Nullable;
public class AccountIdentityResponse {
private final UUID uuid;
private final String number;
private final UUID pni;
@Nullable
private final String username;
private final boolean storageCapable;
@JsonCreator
public AccountIdentityResponse(
@JsonProperty("uuid") final UUID uuid,
@JsonProperty("number") final String number,
@JsonProperty("pni") final UUID pni,
@JsonProperty("username") @Nullable final String username,
@JsonProperty("storageCapable") final boolean storageCapable) {
this.uuid = uuid;
this.number = number;
this.pni = pni;
this.username = username;
this.storageCapable = storageCapable;
}
public UUID getUuid() {
return uuid;
}
public String getNumber() {
return number;
}
public UUID getPni() {
return pni;
}
@Nullable
public String getUsername() {
return username;
}
public boolean isStorageCapable() {
return storageCapable;
}
public record AccountIdentityResponse(UUID uuid,
String number,
UUID pni,
@Nullable String username,
boolean storageCapable) {
}