- public static byte[] decodeGroupId(String groupId) throws GroupIdFormatException {
- try {
- return Base64.decode(groupId);
- } catch (IOException e) {
- throw new GroupIdFormatException(groupId, e);
- }
+ public static GroupId decodeGroupId(String groupId) throws GroupIdFormatException {
+ return GroupId.fromBase64(groupId);
+ }
+
+ public static String getLegacyIdentifier(final SignalServiceAddress address) {
+ return address.getNumber().or(() -> address.getUuid().get().toString());
+ }
+
+ public static ObjectMapper createJsonObjectMapper() {
+ var objectMapper = new ObjectMapper();
+ objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.PUBLIC_ONLY);
+ objectMapper.disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
+ return objectMapper;