public sealed interface RecipientIdentifier {
+ String getIdentifier();
+
record NoteToSelf() implements RecipientIdentifier {
public static NoteToSelf INSTANCE = new NoteToSelf();
+
+ @Override
+ public String getIdentifier() {
+ return "Note-To-Self";
+ }
}
sealed interface Single extends RecipientIdentifier {
}
throw new AssertionError("RecipientAddress without identifier");
}
-
- String getIdentifier();
}
record Uuid(UUID uuid) implements Single {
}
}
- record Group(GroupId groupId) implements RecipientIdentifier {}
+ record Group(GroupId groupId) implements RecipientIdentifier {
+
+ @Override
+ public String getIdentifier() {
+ return groupId.toBase64();
+ }
+ }
}