mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Addressed issues from code review.
This commit is contained in:
@@ -301,10 +301,10 @@ public interface DatabaseComponent {
|
||||
void removeTransport(TransportId t) throws DbException;
|
||||
|
||||
/** Sets the status of the given contact. */
|
||||
void setContactStatus(ContactId c, Contact.Status s) throws DbException;
|
||||
void setContactStatus(ContactId c, StorageStatus s) throws DbException;
|
||||
|
||||
/** Sets the status of the given local pseudonym. */
|
||||
void setLocalAuthorStatus(AuthorId a, LocalAuthor.Status s)
|
||||
void setLocalAuthorStatus(AuthorId a, StorageStatus s)
|
||||
throws DbException;
|
||||
|
||||
/** Marks the given message as valid or invalid. */
|
||||
|
||||
21
briar-api/src/org/briarproject/api/db/StorageStatus.java
Normal file
21
briar-api/src/org/briarproject/api/db/StorageStatus.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package org.briarproject.api.db;
|
||||
|
||||
public enum StorageStatus {
|
||||
|
||||
ADDING(0), ACTIVE(1), REMOVING(2);
|
||||
|
||||
private final int value;
|
||||
|
||||
StorageStatus(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static StorageStatus fromValue(int value) {
|
||||
for (StorageStatus s : values()) if (s.value == value) return s;
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user