1 package org
.asamk
.signal
.manager
.storage
.configuration
;
3 import org
.asamk
.signal
.manager
.api
.PhoneNumberSharingMode
;
4 import org
.asamk
.signal
.manager
.storage
.keyValue
.KeyValueEntry
;
5 import org
.asamk
.signal
.manager
.storage
.keyValue
.KeyValueStore
;
7 public class ConfigurationStore
{
9 private final KeyValueStore keyValueStore
;
11 private final KeyValueEntry
<Boolean
> readReceipts
= new KeyValueEntry
<>("config-read-receipts", Boolean
.class);
12 private final KeyValueEntry
<Boolean
> unidentifiedDeliveryIndicators
= new KeyValueEntry
<>(
13 "config-unidentified-delivery-indicators",
15 private final KeyValueEntry
<Boolean
> typingIndicators
= new KeyValueEntry
<>("config-typing-indicators",
17 private final KeyValueEntry
<Boolean
> linkPreviews
= new KeyValueEntry
<>("config-link-previews", Boolean
.class);
18 private final KeyValueEntry
<Boolean
> phoneNumberUnlisted
= new KeyValueEntry
<>("config-phone-number-unlisted",
20 private final KeyValueEntry
<PhoneNumberSharingMode
> phoneNumberSharingMode
= new KeyValueEntry
<>(
21 "config-phone-number-sharing-mode",
22 PhoneNumberSharingMode
.class);
24 public ConfigurationStore(final KeyValueStore keyValueStore
) {
25 this.keyValueStore
= keyValueStore
;
28 public Boolean
getReadReceipts() {
29 return keyValueStore
.getEntry(readReceipts
);
32 public void setReadReceipts(final boolean value
) {
33 keyValueStore
.storeEntry(readReceipts
, value
);
36 public Boolean
getUnidentifiedDeliveryIndicators() {
37 return keyValueStore
.getEntry(unidentifiedDeliveryIndicators
);
40 public void setUnidentifiedDeliveryIndicators(final boolean value
) {
41 keyValueStore
.storeEntry(unidentifiedDeliveryIndicators
, value
);
44 public Boolean
getTypingIndicators() {
45 return keyValueStore
.getEntry(typingIndicators
);
48 public void setTypingIndicators(final boolean value
) {
49 keyValueStore
.storeEntry(typingIndicators
, value
);
52 public Boolean
getLinkPreviews() {
53 return keyValueStore
.getEntry(linkPreviews
);
56 public void setLinkPreviews(final boolean value
) {
57 keyValueStore
.storeEntry(linkPreviews
, value
);
60 public Boolean
getPhoneNumberUnlisted() {
61 return keyValueStore
.getEntry(phoneNumberUnlisted
);
64 public void setPhoneNumberUnlisted(final boolean value
) {
65 keyValueStore
.storeEntry(phoneNumberUnlisted
, value
);
68 public PhoneNumberSharingMode
getPhoneNumberSharingMode() {
69 return keyValueStore
.getEntry(phoneNumberSharingMode
);
72 public void setPhoneNumberSharingMode(final PhoneNumberSharingMode value
) {
73 keyValueStore
.storeEntry(phoneNumberSharingMode
, value
);