mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Refactor and create a RestoreAccount class which does the combining
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package org.briarproject.briar.socialbackup;
|
||||
|
||||
import org.briarproject.bramble.api.contact.Contact;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.bramble.api.plugin.TransportId;
|
||||
import org.briarproject.bramble.api.properties.TransportProperties;
|
||||
import org.briarproject.briar.api.socialbackup.Shard;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
class ContactData {
|
||||
|
||||
private final Contact contact;
|
||||
private final Map<TransportId, TransportProperties> properties;
|
||||
@Nullable
|
||||
private final Shard shard;
|
||||
|
||||
ContactData(Contact contact,
|
||||
Map<TransportId, TransportProperties> properties,
|
||||
@Nullable Shard shard) {
|
||||
this.contact = contact;
|
||||
this.properties = properties;
|
||||
this.shard = shard;
|
||||
}
|
||||
|
||||
public Contact getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public Map<TransportId, TransportProperties> getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Shard getShard() {
|
||||
return shard;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.briarproject.briar.socialbackup;
|
||||
|
||||
import org.briarproject.bramble.api.identity.Identity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SocialBackup {
|
||||
private Identity identity;
|
||||
private List<org.briarproject.briar.api.socialbackup.ContactData> contacts;
|
||||
private int version;
|
||||
|
||||
SocialBackup (Identity identity, List<org.briarproject.briar.api.socialbackup.ContactData> contacts, int version) {
|
||||
this.identity = identity;
|
||||
this.contacts = contacts;
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Identity getIdentity() {
|
||||
return identity;
|
||||
}
|
||||
|
||||
public List<org.briarproject.briar.api.socialbackup.ContactData> getContacts() {
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package org.briarproject.briar.api.socialbackup.recovery;
|
||||
|
||||
public interface RestoreAccount {
|
||||
}
|
||||
Reference in New Issue
Block a user