1 package org
.asamk
.signal
.manager
.storage
.recipients
;
3 import org
.signal
.zkgroup
.profiles
.ProfileKey
;
4 import org
.signal
.zkgroup
.profiles
.ProfileKeyCredential
;
5 import org
.whispersystems
.signalservice
.api
.push
.SignalServiceAddress
;
7 public class Recipient
{
9 private final RecipientId recipientId
;
11 private final SignalServiceAddress address
;
13 private final Contact contact
;
15 private final ProfileKey profileKey
;
17 private final ProfileKeyCredential profileKeyCredential
;
19 private final Profile profile
;
22 final RecipientId recipientId
,
23 final SignalServiceAddress address
,
24 final Contact contact
,
25 final ProfileKey profileKey
,
26 final ProfileKeyCredential profileKeyCredential
,
29 this.recipientId
= recipientId
;
30 this.address
= address
;
31 this.contact
= contact
;
32 this.profileKey
= profileKey
;
33 this.profileKeyCredential
= profileKeyCredential
;
34 this.profile
= profile
;
37 private Recipient(final Builder builder
) {
38 recipientId
= builder
.recipientId
;
39 address
= builder
.address
;
40 contact
= builder
.contact
;
41 profileKey
= builder
.profileKey
;
42 profileKeyCredential
= builder
.profileKeyCredential
;
43 profile
= builder
.profile
;
46 public static Builder
newBuilder() {
50 public static Builder
newBuilder(final Recipient copy
) {
51 Builder builder
= new Builder();
52 builder
.recipientId
= copy
.getRecipientId();
53 builder
.address
= copy
.getAddress();
54 builder
.contact
= copy
.getContact();
55 builder
.profileKey
= copy
.getProfileKey();
56 builder
.profileKeyCredential
= copy
.getProfileKeyCredential();
57 builder
.profile
= copy
.getProfile();
61 public RecipientId
getRecipientId() {
65 public SignalServiceAddress
getAddress() {
69 public Contact
getContact() {
73 public ProfileKey
getProfileKey() {
77 public ProfileKeyCredential
getProfileKeyCredential() {
78 return profileKeyCredential
;
81 public Profile
getProfile() {
85 public static final class Builder
{
87 private RecipientId recipientId
;
88 private SignalServiceAddress address
;
89 private Contact contact
;
90 private ProfileKey profileKey
;
91 private ProfileKeyCredential profileKeyCredential
;
92 private Profile profile
;
97 public Builder
withRecipientId(final RecipientId val
) {
102 public Builder
withAddress(final SignalServiceAddress val
) {
107 public Builder
withContact(final Contact val
) {
112 public Builder
withProfileKey(final ProfileKey val
) {
117 public Builder
withProfileKeyCredential(final ProfileKeyCredential val
) {
118 profileKeyCredential
= val
;
122 public Builder
withProfile(final Profile val
) {
127 public Recipient
build() {
128 return new Recipient(this);