1 package org
.asamk
.signal
.manager
.storage
.recipients
;
3 import org
.signal
.zkgroup
.profiles
.ProfileKey
;
4 import org
.signal
.zkgroup
.profiles
.ProfileKeyCredential
;
6 public class Recipient
{
8 private final RecipientId recipientId
;
10 private final RecipientAddress address
;
12 private final Contact contact
;
14 private final ProfileKey profileKey
;
16 private final ProfileKeyCredential profileKeyCredential
;
18 private final Profile profile
;
21 final RecipientId recipientId
,
22 final RecipientAddress address
,
23 final Contact contact
,
24 final ProfileKey profileKey
,
25 final ProfileKeyCredential profileKeyCredential
,
28 this.recipientId
= recipientId
;
29 this.address
= address
;
30 this.contact
= contact
;
31 this.profileKey
= profileKey
;
32 this.profileKeyCredential
= profileKeyCredential
;
33 this.profile
= profile
;
36 private Recipient(final Builder builder
) {
37 recipientId
= builder
.recipientId
;
38 address
= builder
.address
;
39 contact
= builder
.contact
;
40 profileKey
= builder
.profileKey
;
41 profileKeyCredential
= builder
.profileKeyCredential
;
42 profile
= builder
.profile
;
45 public static Builder
newBuilder() {
49 public static Builder
newBuilder(final Recipient copy
) {
50 Builder builder
= new Builder();
51 builder
.recipientId
= copy
.getRecipientId();
52 builder
.address
= copy
.getAddress();
53 builder
.contact
= copy
.getContact();
54 builder
.profileKey
= copy
.getProfileKey();
55 builder
.profileKeyCredential
= copy
.getProfileKeyCredential();
56 builder
.profile
= copy
.getProfile();
60 public RecipientId
getRecipientId() {
64 public RecipientAddress
getAddress() {
68 public Contact
getContact() {
72 public ProfileKey
getProfileKey() {
76 public ProfileKeyCredential
getProfileKeyCredential() {
77 return profileKeyCredential
;
80 public Profile
getProfile() {
84 public static final class Builder
{
86 private RecipientId recipientId
;
87 private RecipientAddress address
;
88 private Contact contact
;
89 private ProfileKey profileKey
;
90 private ProfileKeyCredential profileKeyCredential
;
91 private Profile profile
;
96 public Builder
withRecipientId(final RecipientId val
) {
101 public Builder
withAddress(final RecipientAddress val
) {
106 public Builder
withContact(final Contact val
) {
111 public Builder
withProfileKey(final ProfileKey val
) {
116 public Builder
withProfileKeyCredential(final ProfileKeyCredential val
) {
117 profileKeyCredential
= val
;
121 public Builder
withProfile(final Profile val
) {
126 public Recipient
build() {
127 return new Recipient(this);