mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-03 12:50:37 +00:00
Use record classes
This commit is contained in:
parent
ce70a623c2
commit
ce7aa580b6
66 changed files with 754 additions and 1877 deletions
|
@ -1,19 +1,10 @@
|
|||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.whispersystems.signalservice.api.messages.shared.SharedContact;
|
||||
|
||||
public class JsonContactAvatar {
|
||||
public record JsonContactAvatar(JsonAttachment attachment, boolean isProfile) {
|
||||
|
||||
@JsonProperty
|
||||
private final JsonAttachment attachment;
|
||||
|
||||
@JsonProperty
|
||||
private final boolean isProfile;
|
||||
|
||||
public JsonContactAvatar(SharedContact.Avatar avatar) {
|
||||
attachment = new JsonAttachment(avatar.getAttachment());
|
||||
isProfile = avatar.isProfile();
|
||||
static JsonContactAvatar from(SharedContact.Avatar avatar) {
|
||||
return new JsonContactAvatar(JsonAttachment.from(avatar.getAttachment()), avatar.isProfile());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue